![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
this is my final project in a class. this program is used to analog a transportation schedule systems
Fork of app-board-Joystick-with-LCD by
Diff: main.cpp
- Revision:
- 0:3cb0e69f1806
- Child:
- 1:7af7e8d3a37f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Oct 08 11:13:01 2013 +0000 @@ -0,0 +1,41 @@ +#include "mbed.h" +#include "C12832_lcd.h" + +// LCD and Joystick Setting +C12832_LCD lcd; + +BusIn Up(p15); +BusIn Down(p12); +BusIn Left(p13); +BusIn Right(p16); +BusOut Reset(p14); + +// Custom Function +void initialize(); + +// Main +int main() +{ + initialize(); + while(1) + { + lcd.locate(0,15); // Set Location print a text + // Operations by Joystic + if (Up) + lcd.printf("UP"); + if (Down) + lcd.printf("Down"); + if (Left) + lcd.printf("Left"); + if (Right) + lcd.printf("Right"); + if (Reset) + initialize(); + } +} +void initialize() +{ + lcd.cls(); + lcd.locate(0,0); + lcd.printf("Joystic and LCD Controller!"); +} \ No newline at end of file