a
Dependencies: Led-libary TextLCD mbed
Fork of Mbed-Mensch-8 by
Diff: main.cpp
- Revision:
- 26:de10b06e7d4d
- Parent:
- 25:b31b49d277fd
- Child:
- 27:15a37d3fb5c5
--- a/main.cpp Fri Apr 08 09:27:30 2016 +0000 +++ b/main.cpp Fri Apr 08 10:16:45 2016 +0000 @@ -1112,11 +1112,11 @@ if (DD_D&&DprellEn) { accept(); + DprellEn=0; } if(DD_D==0) { - DprellEn=0; - Dprell.attach_us(&DprellRun,500); + Dprell.attach_us(&DprellRun,350); } } DD_d = DD_D; @@ -1281,7 +1281,6 @@ //wuerfel helligkeit -> 50% break; case 0x16: - out = 1; //Farbe -> R selctecolor = 1; break; @@ -1289,10 +1288,10 @@ out = 0; //Farbe -> R selctecolor++; - if(selctecolor==4) + if(selctecolor>=4) { - depth--; - mSelected[depth]=0; + mSelected[depth - 1]=0; + out = 1; } else mSelected[depth - 1]++; @@ -1315,11 +1314,11 @@ { if (selctecolor) { - char temp = TestC&0xff<<(3-selctecolor); - TestC = TestC&(0xFFFFFF-(0xff<<(3-selctecolor))); + char temp = TestC&0xff<<((3-selctecolor)<<1); + TestC = TestC&(0xFFFFFF-(0xff<<((3-selctecolor)<<1))); if(temp<0xFF) temp++; - TestC=TestC|temp<<(3-selctecolor); + TestC=TestC|temp<<((3-selctecolor)<<1); } else if (depth > 0) @@ -1343,11 +1342,11 @@ { if (selctecolor) { - char temp = TestC&0xff<<(3-selctecolor); - TestC = TestC&(0xFFFFFF-(0xff<<(3-selctecolor))); + char temp = TestC&0xff<<((3-selctecolor)<<1); + TestC = TestC&(0xFFFFFF-(0xff<<((3-selctecolor)<<1))); if(temp>0) temp--; - TestC=TestC|temp<<(3-selctecolor); + TestC=TestC|temp<<((3-selctecolor)<<1); } else if (depth > 0) @@ -1425,6 +1424,7 @@ void exit() { + port.printf("LExit!\n"); if (depth > 0) { depth--;