Enabling the SPI display in the IDE
Just as in the case of SerialLCD, you'll need to add the supporting code library for your device. For this device, the library is found at http://www.sainsmart.com/sainsmart-1-8-spi-lcd-module-with-microsd-led-backlight-for-arduino-mega-atmel-atmega.html. In order to do so, perform the following steps:
Go to the site and then click on the Download link. This will download the TFT18.rar file. Use an archive tool such as 7-Zip to unpack this file to the libraries directory.
Now the library will be available for use. You will need to make one change. Go to the library directory where you installed
TFT18
and look for a file calledST7735.h
, as shown in the following screenshot:You're going to edit the
ST7735.h
file. You can do that in Notepad if you are working on a Windows system. You are going to change one line, as follows:You are going to comment out the line that reads
#include <WProgram.h>
using two//
characters. Then, you will add the#include...