Maida Ahmic
/
LaufTest
test programm
Diff: main.cpp
- Revision:
- 2:d1f995867839
- Parent:
- 1:54883b2b3a1f
- Child:
- 3:0a89775f58f1
--- a/main.cpp Mon Jan 13 17:32:16 2020 +0000 +++ b/main.cpp Mon Jan 13 17:40:44 2020 +0000 @@ -5,8 +5,8 @@ //int modifyBit(int x,unsigned char position,bool State); //int lauflicht(bool richtung,int time,int &anz); -//void nibbleLeds(int value); -//void printb(uint8_t x); +void nibbleLeds(int value); +void printb(uint8_t x); void nibbleLeds(int value); @@ -20,10 +20,16 @@ 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