Announcement

Collapse
No announcement yet.

problems cls() uLCD-32PT(SGC)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • problems cls() uLCD-32PT(SGC)

    Quite new at this.
    I use the ulcd-32pt(SGC) with an mbed over the serial port.
    All works fine, I am trying all the functions like pixel etc. This works all good. When I want to clean the screen with a function the screen doesnt display anything after that. The function does work bcs I use a control led on/off every time it is called(by a button).
    When I get the"lcd.cls();" out the program works as supposed to be.

    Any suggestions would be very welcome.

    #include "TFT_4DGL.h"
    #include "mbed.h"

    TFT_4DGL lcd(p9,p10,p11);
    InterruptIn event(p16);
    DigitalOut myled1(LED1);
    DigitalOut myled2(LED2);
    DigitalOut myled3(LED3);
    DigitalOut myled4(LED4);

    int b=0;
    int a=0;
    int n = WHITE;
    int x=1;
    int y=1;


    void trigger() {
    if (b==1)
    b= 0;
    else b=1;
    myled1 = b; // control_led on / off
    x=0; a= 1; y=y+2;
    if (y >= 20)
    lcd.cls(); // cleans screen when y>=20 then screen doesnt work anymore
    }

    int main() {

    event.rise(&trigger);// button
    while(1)//endless loop
    {

    while(a==1)
    {

    x=x+1;
    lcd.pixel(x,y,n);
    if (x == 310)
    a=0;// stop routine
    }
    }
    return 0;
    }
Working...
X