acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

TFT_ReadWrite_Test.ino (705B)

      1 // Walking 1 write and read pixel test
      2 
      3 #include <TFT_eSPI.h>
      4 #include <SPI.h>
      5 
      6 #define TDELAY 500
      7 
      8 TFT_eSPI tft = TFT_eSPI(); 
      9 
     10 void setup() {
     11   Serial.begin(115200);
     12 
     13   tft.init();
     14   tft.fillScreen(0xF81F);
     15 }
     16 
     17 void loop() {
     18   static uint32_t wr = 1;
     19   static uint32_t rd = 0xFFFFFFFF;
     20 
     21   delay(TDELAY);
     22 
     23   tft.drawPixel(30,30,wr);
     24   Serial.print(" Pixel value written = ");Serial.println(wr,HEX);
     25   
     26   rd = tft.readPixel(30,30);
     27                 Serial.print(" Pixel value read    = ");Serial.println(rd,HEX);
     28 
     29   if (rd!=wr) {
     30     Serial.println(" ERROR                 ^^^^");
     31     //while(1) yield();
     32   }
     33   else Serial.println(" PASS ");
     34   // Walking 1 test
     35   wr = wr<<1;
     36   if (wr >= 0x10000) wr = 1;
     37 }