Matthias Praja
/
RGB-15
RGB
Fork of RGB-15 by
Diff: main.cpp
- Revision:
- 1:28cfac75543f
- Parent:
- 0:cce97dfa8e6b
- Child:
- 2:1317061163f8
diff -r cce97dfa8e6b -r 28cfac75543f main.cpp --- a/main.cpp Tue Jul 07 20:26:04 2015 +0000 +++ b/main.cpp Tue Jul 07 20:36:32 2015 +0000 @@ -51,6 +51,14 @@ i2c.write(~0x00); i2c.stop(); + int waiting = 0; + bool active = false; + + enable = 1; + online = 1; + while(1){ + myled=myline; + } while(1){ // Einlesen der Taster und speichern unter data i2c.start(); @@ -60,6 +68,25 @@ i2c.write(0x41); data = i2c.read(0); i2c.stop(); + + if(active) + { + enable = 1; + online = 1; + } + else + { + if(waiting<8) + waiting++; + else + { + enable = 1; + online = 1; + + enable = 0; + online = 0; + } + } //01->forneMitte //02->hintenMitte