This program work with LCD e Timeout

Dependencies:   TextLCD mbed

main.cpp

Committer:
luizlago
Date:
2011-07-02
Revision:
0:e07fa0ef1293

File content as of revision 0:e07fa0ef1293:

// Hello World! for the TextLCD

#include "mbed.h"
#include "TextLCD.h"

Timeout timeTick;
TextLCD lcd(p15, p16, p17, p18, p19, p20); // rs, e, d4-d7

void onTimeout() {
    static int estado = 0;
    
    if (estado == 0)
    {
        lcd.cls();
        lcd.printf("Hello World!!!");
        estado = 1;
        timeTick.attach(&onTimeout, 1);
    }
    else 
    {
        lcd.cls();
        estado = 0;
        timeTick.attach(&onTimeout, 0.5);
    }
}

int main() {
    
    timeTick.attach(&onTimeout, 2);
    
    while(1) {
    }
}