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.
Diff: main.cpp
- Revision:
- 2:da59c940bc1b
- Parent:
- 1:f92ffd7d6a00
- Child:
- 3:6041499f4c0f
diff -r f92ffd7d6a00 -r da59c940bc1b main.cpp
--- a/main.cpp Mon Jan 13 17:20:54 2020 +0000
+++ b/main.cpp Mon Jan 13 17:26:44 2020 +0000
@@ -14,9 +14,17 @@
uint8_t value = INIT;
nibbleLeds(value);
+ printb(value);
wait(0.1);
}
+void printb(uint8_t x){
+ for(int i = sizeof(x)<<3; i; i--){
+ putchar('0'+((x>>(i-1))&1));
+ printf("\n");
+ }
+}
+
void nibbleLeds(int value){
myleds = value%16;
}
\ No newline at end of file