This is my first programming using a 4 X 4 key pad to communicate with the mbed to the LCD.
Dependencies: keypad TextLCD mbed
main.cpp
- Committer:
- daryl2110
- Date:
- 2011-11-11
- Revision:
- 0:5ebae8c9ec22
File content as of revision 0:5ebae8c9ec22:
#include "mbed.h" #include "TextLCD.h" #include "keypad.h" DigitalOut myLed(LED1); Keypad telepad(p28, p27, p26, p25, p24, p23, p22, p21); TextLCD lcd(p15, p16, p17, p18, p19, p20); int main (){ char key; int x = 5, y = 0; /* lcd.printf("Loading."); wait(0.5); lcd.cls(); lcd.printf("Loading.."); wait(0.5); lcd.cls(); lcd.printf("Loading..."); wait(2); lcd.cls(); lcd.printf("Hello :))"); wait(2); lcd.cls(); */ lcd.printf("BUS:"); while (1) { key = telepad.getKey(); if (key != KEY_RELEASED){ lcd.putc(key); lcd.locate(x++, y); wait(1); if (key == '*') lcd.locate(0,1); } } }