Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of bynary_counting_Hello_World by
Diff: main.cpp
- Revision:
- 0:d6f93f0e46d4
- Child:
- 1:77d533d0d869
diff -r 000000000000 -r d6f93f0e46d4 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Dec 07 21:20:43 2010 +0000
@@ -0,0 +1,30 @@
+#include "mbed.h"
+
+DigitalOut bitzero(LED1);
+DigitalOut bitone(LED2);
+DigitalOut bittwo(LED3);
+DigitalOut bitthree(LED4);
+
+int main() {
+
+ int counter;
+ int b3,b2,b1,b0;
+
+ while (1) {
+ for (counter = 0; counter < 16; counter++) {
+
+ b3=(counter > 7);
+ b2=((counter-(b3*8)) > 3);
+ b1=((counter-(b3*8)-(b2*4)) > 1);
+ b0=((counter-(b3*8)-(b2*4)-(b1*2)) > 0);
+
+ bitthree = b3;
+ bittwo = b2;
+ bitone = b1;
+ bitzero = b0;
+
+ wait(0.5);
+ }
+ counter = 0;
+ }
+}
