diff --git a/IR-protocol.ino b/IR-protocol.ino index d704109..2cafeba 100644 --- a/IR-protocol.ino +++ b/IR-protocol.ino @@ -193,6 +193,9 @@ void setup() { bool testLed = false; uint32_t testLed_timer; +bool responsponse_f = false; +uint32_t responsponse_tim;; + void loop() { // digitalToggle(LoopOut); Timer::tick(); @@ -230,7 +233,11 @@ void loop() { if(testLed && millis() - testLed_timer > 100){ testLed=false; digitalWrite(12, LOW); + } + if(responsponse_f && millis() - responsponse_tim > 100) { + responsponse_f=false; + encForward.sendData(IR_Broadcast, cmd_oar_car); } } @@ -239,7 +246,6 @@ void loop() { - //test void status(IR_Decoder& dec) { if (dec.gotData.available() && dec.gotData.getAddrFrom() != 42) { @@ -248,8 +254,8 @@ void status(IR_Decoder& dec) { testLed = true; testLed_timer = millis(); - encForward.sendData(IR_Broadcast, cmd_oar_car); - + responsponse_f = true; + responsponse_tim = testLed_timer; String str; if (/* dec.gotData.getDataPrt()[1] */1) {