This simply counts from 0-15 continuously, displaying the binary value using the LED\'s along the bottom of the mbed.
Diff: main.cpp
- Revision:
- 0:06901945ebc5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jun 24 15:39:13 2011 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" + +DigitalOut l1(LED1); +DigitalOut l2(LED2); +DigitalOut l3(LED3); +DigitalOut l4(LED4); + +#define D() wait(0.5) + +int main() { + + int count = 0; + while (1) + { + if (count & 0x08) l1 = 1; + if (count & 0x04) l2 = 1; + if (count & 0x02) l3 = 1; + if (count & 0x01) l4 = 1; + + D(); + l1=l2=l3=l4=0; + if (count==15) count = 0; + else count++; + } + +} \ No newline at end of file