Step-by-step instruction:
2. Mount your LCD shield on to your arduino UNO
3. Connect your UNO to computer via USB cable. Please make sure the UNO is correctly recognized by the computer. In device manager, you should be able to see arduino UNO or CH340 device.
4. Select the port and board/processor accordingly
5. Open one of the sketches below and have fun
Instructions for the older version or 2.4" LCD for some other brand LCD screens
- Download and copy Adafruit_GFX library from GitHub into your libraries folder.
- Copy the content from MCUFRIEND_kbv.zip to your libraries folder.
- Install the LCD shield, then connect your Arduino board to your computer using USB cable.
- Start Arduino IDE.
- Launch test sketch from File->Examples->Mcufriend_kbv menu->UTFT_Demo_320x240 or graphictest_kbv *The graphictest sketch will provide you some basic information and test some basic functions.
Next, download the modified sketch for TFTpaint, from which you will learn how to use the touchscreen function of this LCD shield. In order for this sketch to work properly, you will need the following two libraries. (Download, unzip and copy to your Arduino IDE library folder.)
Troubleshooting
If your x, y coordinates of the Touch Screen are inverted, try comment/uncomment line 51/53 in the TFFTLCD.CPP file. If you get a white screen it is probably because there is already a TFTLCD.cpp file in your library. Find the following code in your TFTLCD.CPP file and add delay as showing below:
for (uint8_t i = 0; i < sizeof(_regValues) / 4; i++) {
a = pgm_read_word(_regValues + i*2);
d = pgm_read_word(_regValues + i*2 + 1);
// a = pgm_read_word(&_regValues[i++]);
//d = pgm_read_word(&_regValues[i++]);
if (a == 0xFF) {
delay(d);
} else {
writeRegister(a, d);
//Serial.print(“addr: “); Serial.print(a);
//Serial.print(” data: “); Serial.println(d, HEX);
//
delay(20); // insert a new delay time
//
}
}
}