// Pins SCLK and MOSI are fixed in hardware, and pin 10 (or 53) // must be an output//#define sclk 13 // for MEGAs use pin 52//#define mosi 11 // for MEGAs use pin 51#define cs 10 // for MEGAs you probably want this to be pin 53#define dc 9#define rst 8 // you can also connect this to the Arduino reset

// 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)ST7735 tft = ST7735(cs, dc, rst);

// 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)//ST7735 tft = ST7735(cs, dc, rst);

// to draw images from the SD card, we will share the hardware SPI interfaceST7735 tft = ST7735(cs, dc, rst);

// 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)// Then pin 4 goes to CS (or whatever you have set up)#define SD_CS 4 // Set the chip select line to whatever you use (4 doesnt conflict with the library)

/*********************************************/// This procedure reads a bitmap and draws it to the screen// its sped up by reading many pixels worth of data at a time// instead of just one pixel at a time. increading the buffer takes// more RAM but makes the drawing a little faster. 20 pixels' worth// is probably a good place

SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS). These pins support SPI communication using the SPI library. The SPI pins are also broken out on the ICSP header, which is physically compatible with the Uno, Duemilanove and Diecimila.

// Pins SCLK and MOSI are fixed in hardware, and pin 10 (or 53) // must be an output//#define sclk 13 // for MEGAs use pin 52//#define mosi 11 // for MEGAs use pin 51#define cs 10 // for MEGAs you probably want this to be pin 53#define dc 9#define rst 8 // you can also connect this to the Arduino reset

// 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)ST7735 tft = ST7735(cs, dc, rst);