Lab 2.5
Dependencies: mbed mbed-rtos C12832_lcd LCD_fonts
Diff: main.cpp
- Revision:
- 4:682b2fc13702
- Parent:
- 3:3ec443c0842a
--- a/main.cpp Wed Dec 05 08:06:20 2012 +0000 +++ b/main.cpp Fri Jul 31 15:34:31 2020 +0000 @@ -10,6 +10,13 @@ #include "stdio.h" #include "C12832_lcd.h" + +BusIn joy(p15,p12,p13,p16); +DigitalIn fire(p14); + +BusOut leds(LED1,LED2,LED3,LED4); + + // LCD object C12832_LCD LCD; @@ -95,6 +102,9 @@ } + + + // print the actual contrast int main() { @@ -114,6 +124,12 @@ LCD.printf("contrast : %d",j); lcd_mutex.unlock(); Thread::wait(500); // wait 0.5s + if (fire) { //New code imported to control LEDs with joystick + leds=0xf; + } else { + leds=joy; + } + wait(0.1); } }