fork
Dependencies: mbed mbed-rtos C12832_lcd LCD_fonts
Revision 4:1229f672b999, committed 2020-07-31
- Comitter:
- saltire78
- Date:
- Fri Jul 31 13:16:40 2020 +0000
- Parent:
- 3:3ec443c0842a
- Commit message:
- A combined multi-thread program displaying a PWM frequency on an LCD
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Dec 05 08:06:20 2012 +0000 +++ b/main.cpp Fri Jul 31 13:16:40 2020 +0000 @@ -16,6 +16,10 @@ AnalogIn Pot1(p19); AnalogIn Pot2(p20); +BusIn joy(p15,p12,p13,p16); +DigitalIn fire(p14); + +BusOut leds(LED1,LED2,LED3,LED4); // mutex to make the lcd lib thread save Mutex lcd_mutex; @@ -95,6 +99,20 @@ } +// Thread 5 +// controls order/sequence of LED's to light up +void thread5(void const *args) +{ + while(true) { // thread loop + if (fire) { + leds=0xf; + } else { + leds=joy; + } + wait(0.1); + } +} + // print the actual contrast int main() { @@ -105,6 +123,7 @@ Thread t2(thread2); //start thread2 Thread t3(thread3); //start thread3 Thread t4(thread4); //start thread4 + Thread t5(thread5); //start thread4 while(true) { // main is the next thread lcd_mutex.lock();