-
-
Save seco/49df58d5e95d306da5e1c39e889c1a11 to your computer and use it in GitHub Desktop.
lgacdecode.ino
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <IRremoteESP8266.h> | |
| //#include <IRremote.h> | |
| int RECV_PIN = 14; | |
| IRrecv irrecv(RECV_PIN); | |
| void setup ( ) | |
| { | |
| Serial.begin(115200); | |
| irrecv.enableIRIn(); | |
| } | |
| void dumpInfo(decode_results *results) | |
| { | |
| if (results->bits == 28 || results->bits == 32) | |
| { | |
| Serial.print("bits :"); | |
| Serial.print(results->bits); | |
| Serial.print(" "); | |
| for (int i = 3; i < results->rawlen; i++) { | |
| unsigned long x = results->rawbuf[i] * USECPERTICK; | |
| if (!(i & 1)) | |
| { | |
| if ( x > 1000) | |
| { | |
| Serial.print("1"); | |
| } | |
| else | |
| { | |
| Serial.print("0"); | |
| } | |
| if ( ((i - 2) % 8 ) == 0 ) { | |
| Serial.print(" "); | |
| } | |
| } | |
| } | |
| Serial.println(""); | |
| } | |
| delay(10); | |
| irrecv.resume(); | |
| } | |
| void loop() | |
| { | |
| decode_results results; | |
| if (irrecv.decode(&results)) { | |
| dumpInfo(&results); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment