Go Down

Topic: TFT Display not updating ILI9325 LCD driver  (Read 106 times) previous topic - next topic

BlackendDK

Hi
I'm using a "china version" of the 2,4" TFT Display / ILI9325 LCD driver

I'm trying to update the display in a loop. I need this for updating the screen, when a value changes.

BUT!
As soon as I uncomment  TSPoint p = ts.getPoint(); in the below code, the screen is no longer updating.
The screen is never filled with "WHITE".

If I commet the line again //TSPoint p = ts.getPoint(); everything runs as expected.

Any ideas, what i'm doing wrong ?
Maybe I don't understand the "ts.getPoint()" function ?


Code: [Select]

void redraw(){
  Serial.println("redrawrunning setpoint = "); Serial.println(fSetpoint);
  tft.fillScreen(BLACK);
  tft.setCursor(0, 0);
  tft.setTextColor(WHITE);    tft.setTextSize(1);
  tft.println("Sousvide controller UV, Okt 2016");
  tft.println(""); 
 
  //Actual Temp
  tft.setTextColor(RED);    tft.setTextSize(3);
  tft.print("ACT:"); tft.print(fActualValue); tft.print(" C");
  tft.println("");
  tft.println("");
  //Setpoint temperature
  tft.setTextColor(BLUE);    tft.setTextSize(3);
  tft.print("SET:"); tft.print(fSetpoint); tft.print(" C"); 

  //UPArrow
  tft.fillTriangle(50, 150, 75, 100, 100, 150, GREEN);
  //Downarrow
  tft.fillTriangle(145, 150, 120, 100, 170, 100, GREEN);
}

void loop(void) {


  //TSPoint p = ts.getPoint();

  delay(2000);

    redraw();
    delay(1000);
    tft.fillScreen(WHITE);
    delay(1000);


} // END LOOP

david_prentice

Please post a link to the actual display that you have (or similar Ebay sale)

Mcufriend 2.4" shields share the Touch pins with the other TFT pins.   So you must restore the YP, XM pins to OUTPUT after you use any getPoint() calls.  e.g.
Code: [Select]

    TSPoint p = ts.getPoint();  //point on touchscreen that has been touched
    pinMode(YP, OUTPUT);        //.kbv these pins are shared with TFT
    pinMode(XM, OUTPUT);        //.kbv these pins are shared with TFT


David.

BlackendDK

Thanks very much for the help, that was the solution :-)

The Display is this type : LINK

david_prentice

You have a regular 2.4" Mcufriend Red shield.    I would be very surprised if it contains an ILI9325 unless it is quite old.

My library will identify most controllers.

David.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy