gdfgdh
Dependencies: ELEC350-Practicals-FZ429
Fork of Task633-mbedos-FZ429 by
Revision 14:03836b560d3d, committed 2017-11-21
- Comitter:
- noutram
- Date:
- Tue Nov 21 11:53:44 2017 +0000
- Parent:
- 13:f05daa68720c
- Commit message:
- Updated for FZ429
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Nov 21 11:36:41 2017 +0000 +++ b/main.cpp Tue Nov 21 11:53:44 2017 +0000 @@ -88,6 +88,8 @@ //Normal priority thread (consumer) void thread1() { + static int counter = 0; + while (true) { //Block on the queue osEvent evt = mail_box.get(); @@ -104,10 +106,22 @@ printf("ADC Value: %.2f\t", msg.adcValue); printf("SW1: %u\t", msg.sw1State); printf("SW2: %u\n\r", msg.sw2State); + + //Toggle green + if ( (msg.sw1State == 1) && (msg.sw2State == 1)) { + counter++; + if (counter == 10) { + greenLED = !greenLED; + counter = 0; + } + } else { + counter = 0; + } + } else { printf("ERROR: %x\n\r", evt.status); } - + } //end while }