This simply counts from 0-15 continuously, displaying the binary value using the LED\'s along the bottom of the mbed.
Revision 0:06901945ebc5, committed 2011-06-24
- Comitter:
- chrisvarns
- Date:
- Fri Jun 24 15:39:13 2011 +0000
- Commit message:
- FINAL
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Jun 24 15:39:13 2011 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912