![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
main lauflicht test
Diff: main.cpp
- Revision:
- 4:8d806106dbb0
- Parent:
- 3:f82a2b7fb723
- Child:
- 5:c2a8fd8dede5
--- a/main.cpp Mon Jan 13 17:25:57 2020 +0000 +++ b/main.cpp Mon Jan 13 17:31:32 2020 +0000 @@ -3,7 +3,7 @@ void nibbleLeds(int value); - +void printb(uint8_t x); BusOut myleds(LED1, LED2, LED3, LED4); DigitalIn button(BUTTON1); @@ -19,6 +19,7 @@ uint8_t value = INIT; nibbleLeds(value); + printb(value); wait(0.1); @@ -28,3 +29,10 @@ myleds = value%16; } +void printb(uint8_t x){ + for(int i=sizeof(x)<<3; i; i--) + putchar('0'+((x>>(i-1))&1)); + printf("\n"); + + +}