![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
buzzer, switch, led for the CORE-1000
Diff: main.cpp
- Revision:
- 4:831a73794478
- Parent:
- 2:b60cb847489c
diff -r f57d754b1814 -r 831a73794478 main.cpp --- a/main.cpp Thu Nov 06 10:13:20 2014 +0000 +++ b/main.cpp Fri Feb 03 07:48:22 2017 +0000 @@ -1,12 +1,23 @@ #include "mbed.h" -DigitalOut myled(LED1); - +DigitalOut mybuzzer(PC_4); +//DigitalOut myled [4] = { PH_0, PH_1, PC_2, PC_3}; +DigitalOut myled [4] = { PC_9, PB_2, PC_2, PC_3}; +DigitalIn enable[4] = {PC_10,PC_11, PC_12, PA_13 }; int main() { while(1) { - myled = 1; // LED is ON + mybuzzer = 1; // LED is ON wait(0.2); // 200 ms - myled = 0; // LED is OFF + mybuzzer = 0; // LED is OFF wait(1.0); // 1 sec + for(int i = 0; i < 4 ; i++) + { + if(!(enable[i])) + { + myled[i] = 1; + wait(0.25); + } + else myled[i] = 0; + } } }