![](/media/cache/profiles/ndu.jpg.50x50_q85.jpg)
keyboard input, serial com test
Dependencies: mbed DISCO_L475VG_IOT01A_wifi TextLCD USBHost
Diff: main.cpp
- Revision:
- 5:0466445897b8
- Parent:
- 4:c2cdba0bae47
- Child:
- 6:9d975a9d2728
diff -r c2cdba0bae47 -r 0466445897b8 main.cpp --- a/main.cpp Mon Aug 05 18:26:58 2019 +0000 +++ b/main.cpp Sat Aug 10 08:34:41 2019 +0000 @@ -1,27 +1,26 @@ #include "mbed.h" -#include "TextLCD.h" +#include "inc/display.h" +#include "inc/input.h" DigitalOut led1(LED1); Serial pc(SERIAL_TX, SERIAL_RX); -AnalogIn button(A0); // Init button (SELECT, LEFT, UP, DOWN, RIGHT) -TextLCD lcd(D8, D9, D4, D5, D6, D7); // LCD (RS, E, D4, D5, D6, D7); -PwmOut backlight(D10); // Backlight LCD + + int main() { - // Set backlight period and duty cycle - backlight.period(0.002); - backlight = 1; - - lcd.cls(); // Clear LCD - lcd.locate(1,0); // Set locate (1 row, 2 column) - lcd.printf("LCD Key Shield"); + displayInit(); + inputInit(); + pc.printf("start main()\n\r"); while(1) { - lcd.cls(); - lcd.locate(1,0); - lcd.printf("%f", button.read()); + + + pc.printf("last key:%d \n\r", getKey()); + displayScreen(1); wait(1); led1 = !led1; + displayScreen(0); + wait(1); } }