aliff
Dependencies: TextLCD keypad mbed
Diff: main.cpp
- Revision:
- 0:ee45a62491c4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Jun 04 16:02:58 2018 +0000 @@ -0,0 +1,50 @@ +#include "mbed.h" +#include "keypad.h" +#include "TextLCD.h" + +TextLCD lcd(D8, D9, D4, D5, D6, D7); + + +int main() { + // c0 c1 c2 c3 r0 r1 r2 r3 + Keypad keypad( PC_3,PC_2,PC_0,PC_1,PC_5,PC_4,PB_1,PA_0 ); + + keypad.enablePullUp(); + char key; +// lcd.printf(" "); + while (1) + { + key = keypad.getKey(); + if(key != KEY_RELEASED) + { + lcd.locate (0,0); + lcd.printf("%c",key); + //wait(0.6); + } + if (key=='B') + {lcd.cls(); + lcd.locate (0,0); + lcd.printf("BMT 4033"); + } + if (key=='C') + {lcd.cls(); + lcd.locate (0,0); + lcd.printf("Embedded"); + } + if (key=='D') + {lcd.cls(); + lcd.locate (0,0); + lcd.printf("System"); + } + if (key=='E') + {lcd.cls(); + lcd.locate (0,0); + lcd.printf("Design"); + } + if (key=='F') + {lcd.cls(); + lcd.locate (0,0); + lcd.printf("Score"); + } +} +}