ILI9340 flashing

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
thebearf8
 
Posts: 25
Joined: Tue Jan 21, 2014 4:35 pm

ILI9340 flashing

Post by thebearf8 »

Trying to create a scrolling text but ending up with a flashing motion

Code: Select all

void scroll() {
     tft.setTextColor(ILI9340_WHITE);  
     tft.setTextSize(6);  
     tft.setCursor(0, 10);
     tft.print(message.substring(0, len));
     if (turn == 2) {
        turn = 0;
        tft.fillRect(0, 10, 320, 53, ILI9340_BLACK);
        message = message.substring(1) + message.charAt(0);
     }
     turn++;
}

void loop() {
    scroll();
}
check out https://www.dropbox.com/s/a2rdrrno7t1wtcu/LCD.MOV

Without the fillRect the text just builds on top of itself

Any ideas ?

Thanks in advance

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: ILI9340 flashing

Post by adafruit_support_mike »

Try using the version of 'setTextColor()' that defines a background color:

Code: Select all

     tft.setTextColor(ILI9340_WHITE, ILI9340_BLACK);  
That will refill every pixel in the character rectangle with each frame, eliminating the need for most of the blanking rectangle.

User avatar
thebearf8
 
Posts: 25
Joined: Tue Jan 21, 2014 4:35 pm

Re: ILI9340 flashing

Post by thebearf8 »

Excellent ! !

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”