mbed workshop intro + cansat examples
Diff: Countdown1.cpp
- Revision:
- 0:f309f06aeec7
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Countdown1.cpp Thu May 10 21:14:34 2012 +0000 @@ -0,0 +1,22 @@ +#include "mbed.h" + +DigitalOut myleds[] = {LED1, LED2, LED3, LED4}; + +int main() { + myleds[0] = 1; myleds[1] = 1; myleds[2] = 1; myleds[3] = 1; + wait(1.0); + myleds[0] = 1; myleds[1] = 1; myleds[2] = 1; myleds[3] = 0; + wait(1.0); + myleds[0] = 1; myleds[1] = 1; myleds[2] = 0; myleds[3] = 1; + ... + wait(1.0); + myleds[0] = 0; myleds[1] = 0; myleds[2] = 0; myleds[3] = 0; + wait(0.2); + myleds[0] = 1; myleds[1] = 1; myleds[2] = 1; myleds[3] = 1; + wait(0.2); + myleds[0] = 0; myleds[1] = 0; myleds[2] = 0; myleds[3] = 0; + wait(0.2); + myleds[0] = 1; myleds[1] = 1; myleds[2] = 1; myleds[3] = 1; + ... + myleds[0] = 1; myleds[1] = 1; myleds[2] = 1; myleds[3] = 1; +} \ No newline at end of file