| 17 | IRsend irsend(IR_SEND_PIN); |
| 18 | |
| 19 | void receiveIR() |
| 20 | { |
| 21 | decode_results dresults; |
| 22 | dresults.decode_type = UNUSED; |
| 23 | if(irrecv.decode(&dresults)) { |
| 24 | Serial.println(resultToHumanReadableBasic(&dresults)); // Output the results as source code |
| 25 | Serial.println(resultToTimingInfo(&dresults)); |
| 26 | irrecv.resume(); |
| 27 | } |
| 28 | if(dresults.decode_type > UNUSED) { |
| 29 | Serial.println("Send IR Code"); |
| 30 | irsend.send(dresults.decode_type, dresults.value, dresults.bits); |
| 31 | } |
| 32 | irTimer.startOnce(); |
| 33 | } |
| 34 | |
| 35 | } // namespace |
| 36 | |