![]() The function stroke under the class TFTscreen sets the color to the values sent as arguments. Later, you will assign it to the redRandom pixel.Īlong the same lines, you also generate two random numbers and assign them to the greenRandom and the blueRandom variables. In the above lines you are creating random numbers between 0 and 255. Here we will send the pin numbers to which the chip select, data/command, and the RESET pins are connected. We are creating the object by name TFTScreen of type TFT. If you are using an Arduino Mega or any other Arduino board, you should update the pin numbers accordingly. Here, you are mapping the Arduino UNO pins to the chip select pin, data command pin, and the reset pin. ![]() TFT and SPI headers contain the required functions to interact with the display over the SPI line. The below two lines adds the required libraries for the display module. The summary of the Arduino code is available below. wait 200 miliseconds until change to next color print Hello, World! in the middle of the screen TFTscreen.stroke(redRandom, greenRandom, blueRandom) clear the screen with a black background
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |