mbed workshop intro + cansat examples
Diff: MyLed7.cpp
- Revision:
- 0:f309f06aeec7
diff -r 000000000000 -r f309f06aeec7 MyLed7.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MyLed7.cpp Thu May 10 21:14:34 2012 +0000 @@ -0,0 +1,18 @@ +#include "mbed.h" + +DigitalOut myleds[] = {LED1, LED2, LED3, LED4}; + +void setMyLeds(bool arg) { + for (int i = 0; i < 4; i++) { + myleds[i] = arg; + } +} + +int main() { + while(1) { + setMyLeds(1); + wait(0.2); + setMyLeds(0); + wait(0.2); + } +} \ No newline at end of file