Permalink
Browse files

comments, readme, etc

  • Loading branch information...
1 parent 3a1ed09 commit 2b7f63716fbb0c6742bd23ba83c22d89bda3d564 @ladyada ladyada committed Apr 24, 2012
View
@@ -1,3 +1,19 @@
+/***************************************************
+ This is a library for the Adafruit 2.2" SPI display.
+ This library works with the Adafruit 2.2" TFT Breakout w/SD card
+ ----> http://www.adafruit.com/products/797
+
+ Check out the links above for our tutorials and wiring diagrams
+ These displays use SPI to communicate, 3 or 4 pins are required to
+ interface (RST is optional)
+ Adafruit invests time and resources providing this open source code,
+ please support Adafruit and open-source hardware by purchasing
+ products from Adafruit!
+
+ Written by Limor Fried/Ladyada for Adafruit Industries.
+ MIT license, all text above must be included in any redistribution
+ ****************************************************/
+
#include <avr/pgmspace.h>
#include <util/delay.h>
#include <stdlib.h>
View
@@ -1,3 +1,18 @@
+/***************************************************
+ This is a library for the Adafruit 2.2" SPI display.
+ This library works with the Adafruit 2.2" TFT Breakout w/SD card
+ ----> http://www.adafruit.com/products/797
+
+ Check out the links above for our tutorials and wiring diagrams
+ These displays use SPI to communicate, 3 or 4 pins are required to
+ interface (RST is optional)
+ Adafruit invests time and resources providing this open source code,
+ please support Adafruit and open-source hardware by purchasing
+ products from Adafruit!
+
+ Written by Limor Fried/Ladyada for Adafruit Industries.
+ MIT license, all text above must be included in any redistribution
+ ****************************************************/
#if ARDUINO >= 100
#include "Arduino.h"
View
@@ -0,0 +1,19 @@
+This is a library for the Adafruit 2.2" SPI display.
+This library works with the Adafruit 2.2" TFT Breakout w/SD card
+ ----> http://www.adafruit.com/products/797
+
+Check out the links above for our tutorials and wiring diagrams.
+These displays use SPI to communicate, 3 or 4 pins are required
+to interface (RST is optional).
+Adafruit invests time and resources providing this open source code,
+please support Adafruit and open-source hardware by purchasing
+products from Adafruit!
+
+Written by Limor Fried/Ladyada for Adafruit Industries.
+MIT license, all text above must be included in any redistribution
+
+To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_HX8340B. Check that the Adafruit_HX8340B folder contains Adafruit_HX8340B.cpp and Adafruit_HX8340B.
+
+Place the Adafruit_HX8340B library folder your <arduinosketchfolder>/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE
+
+Also requires the Adafruit_GFX library for Arduino.
@@ -1,12 +1,31 @@
+/***************************************************
+ This is an example sketch for the Adafruit 2.2" SPI display.
+ This library works with the Adafruit 2.2" TFT Breakout w/SD card
+ ----> http://www.adafruit.com/products/797
-#define OLED_MOSI (11) // SDI
-#define OLED_CLK (13) // SCL
-#define OLED_CS (10) // CS
-#define OLED_RESET (9) // RESET
+ Check out the links above for our tutorials and wiring diagrams
+ These displays use SPI to communicate, 3 or 4 pins are required to
+ interface (RST is optional)
+ Adafruit invests time and resources providing this open source code,
+ please support Adafruit and open-source hardware by purchasing
+ products from Adafruit!
+
+ Written by Limor Fried/Ladyada for Adafruit Industries.
+ MIT license, all text above must be included in any redistribution
+ ****************************************************/
#include <Adafruit_GFX.h>
#include <Adafruit_HX8340B.h>
+// if we're using fast hardware SPI on an '328 or '168 arduino such
+// as an Uno, Duemilanove, Diecimila, etc then the MOSI and CLK
+// pins are 'fixed' in hardware. If you'rere using 'bitbang' (slower)
+// interfacing, you can change any of these pins as deired.
+#define TFT_MOSI 11 // SDI
+#define TFT_CLK 13 // SCL
+#define TFT_CS 10 // CS
+#define TFT_RESET 9 // RESET
+
// Color definitions
#define BLACK 0x0000
#define BLUE 0x001F
@@ -20,13 +39,13 @@
#include <SPI.h>
// Option 1: use any pins but much slower
-//Adafruit_HX8340B display(OLED_MOSI, OLED_CLK, OLED_RESET, OLED_CS);
+//Adafruit_HX8340B display(TFT_MOSI, TFT_CLK, TFT_RESET, TFT_CS);
// Option 2: must use the hardware SPI pins
// (for UNO thats sclk = 13 and sid = 11) and pin 10 must be
// an output. This is much faster - also required if you want
// to use the microSD card (see the image drawing example)
-Adafruit_HX8340B display(OLED_RESET, OLED_CS);
+Adafruit_HX8340B display(TFT_RESET, TFT_CS);
float p = 3.1415926;
@@ -42,9 +61,6 @@ void setup(void) {
Serial.println(time, DEC);
delay(500);
-
- //lcdTestPattern();
- //delay(1000);
display.fillScreen(BLACK);
display.setCursor(0,0);
@@ -1,4 +1,18 @@
-// bmp drawing test
+/***************************************************
+ This is an example sketch for the Adafruit 2.2" SPI display.
+ This library works with the Adafruit 2.2" TFT Breakout w/SD card
+ ----> http://www.adafruit.com/products/797
+
+ Check out the links above for our tutorials and wiring diagrams
+ These displays use SPI to communicate, 3 or 4 pins are required to
+ interface (RST is optional)
+ Adafruit invests time and resources providing this open source code,
+ please support Adafruit and open-source hardware by purchasing
+ products from Adafruit!
+
+ Written by Limor Fried/Ladyada for Adafruit Industries.
+ MIT license, all text above must be included in any redistribution
+ ****************************************************/
#include <Adafruit_GFX.h>
#include <Adafruit_HX8340B.h>
@@ -7,10 +21,10 @@
// If we are using the hardware SPI interface, these are the pins (for future ref)
-#define OLED_MOSI (11) // SDI
-#define OLED_CLK (13) // SCL
-#define OLED_CS (10) // CS
-#define OLED_RESET (9) // RESET
+#define TFT_MOSI (11) // SDI
+#define TFT_CLK (13) // SCL
+#define TFT_CS (10) // CS
+#define TFT_RESET (9) // RESET
// Color definitions
#define BLACK 0x0000
@@ -23,7 +37,7 @@
#define WHITE 0xFFFF
// to draw images from the SD card, we will share the hardware SPI interface
-Adafruit_HX8340B display(OLED_RESET, OLED_CS);
+Adafruit_HX8340B display(TFT_RESET, TFT_CS);
// For Arduino Uno/Duemilanove, etc
// connect the SD card with MOSI going to pin 11, MISO going to pin 12 and SCK going to pin 13 (standard)
@@ -44,7 +58,7 @@ void setup(void) {
pinMode(SD_CS, OUTPUT);
digitalWrite(SD_CS, HIGH);
- // initialize the OLED
+ // initialize the TFT
display.begin();
Serial.println("init");
@@ -60,7 +74,7 @@ void setup(void) {
}
Serial.println("SD OK!");
- bmpDraw("lilypad.bmp", 0, 0);
+ bmpDraw("rose.bmp", 0, 0);
}
void loop() {
View
Binary file not shown.

0 comments on commit 2b7f637

Please sign in to comment.