cagdas d
/
lauftest
initial commit and publish
Diff: main.cpp
- Revision:
- 1:dcfefb503be4
- Parent:
- 0:886ff6a91b2c
- Child:
- 2:6a2101a16cef
diff -r 886ff6a91b2c -r dcfefb503be4 main.cpp --- a/main.cpp Mon Jan 13 17:13:54 2020 +0000 +++ b/main.cpp Mon Jan 13 17:21:30 2020 +0000 @@ -5,7 +5,7 @@ DigitalIn button(BUTTON1); void nibbleLeds(int value); - +void printb(uint8_t x); const int INIT = 0x03; @@ -16,7 +16,16 @@ printf("anzahl = %d\n", anzahl); nibbleLeds(value); + printb(myleds); wait(0.1); +} - } +void nibbleLeds(int value) { + myLeds = value % 16; } + +void printb(uint8_t x){ + for(int i = sizeof() << 3; i; i--) + putchar('0' + ((x >> (i - 1)) & 1)); + printf("\n"); +} \ No newline at end of file