Luiz Carlos do Lago
/
teste_lcd
This program work with LCD e Timeout
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 // Hello World! for the TextLCD 00002 00003 #include "mbed.h" 00004 #include "TextLCD.h" 00005 00006 Timeout timeTick; 00007 TextLCD lcd(p15, p16, p17, p18, p19, p20); // rs, e, d4-d7 00008 00009 void onTimeout() { 00010 static int estado = 0; 00011 00012 if (estado == 0) 00013 { 00014 lcd.cls(); 00015 lcd.printf("Hello World!!!"); 00016 estado = 1; 00017 timeTick.attach(&onTimeout, 1); 00018 } 00019 else 00020 { 00021 lcd.cls(); 00022 estado = 0; 00023 timeTick.attach(&onTimeout, 0.5); 00024 } 00025 } 00026 00027 int main() { 00028 00029 timeTick.attach(&onTimeout, 2); 00030 00031 while(1) { 00032 } 00033 }
Generated on Thu Jul 21 2022 13:52:53 by 1.7.2