-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
danielzhu1201
authored
Sep 13, 2017
1 parent
ec5f04e
commit 5dc2ae6
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include <IRremote.h> | ||
int RECV_PIN = 9; | ||
|
||
IRrecv irrecv(RECV_PIN); | ||
|
||
decode_results results; | ||
|
||
void setup() | ||
{ | ||
Serial.begin(9600); | ||
irrecv.enableIRIn(); | ||
} | ||
|
||
void dump(decode_results *results) { | ||
int count = results->rawlen; | ||
Serial.print("Raw ("); | ||
Serial.print(count, DEC); | ||
Serial.print("): "); | ||
|
||
for (int i = 0; i < count; i++) { | ||
if ((i % 2) == 1) { | ||
Serial.print(results->rawbuf[i]*USECPERTICK, DEC); | ||
} | ||
else { | ||
Serial.print(-(int)results->rawbuf[i]*USECPERTICK, DEC); | ||
} | ||
Serial.print(","); | ||
} | ||
Serial.println(""); | ||
} | ||
|
||
|
||
void loop() { | ||
if (irrecv.decode(&results)) { | ||
dump(&results); | ||
irrecv.resume(); | ||
} | ||
} | ||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <IRremote.h> | ||
|
||
IRsend irsend; | ||
unsigned int buf[25]= | ||
{2400,600,1150,600,600,600,1150,600,600,600,1150,600,600,600,550,600,1200,550,600,600,600,600,600,550,600}; | ||
void setup() | ||
{ | ||
|
||
} | ||
|
||
|
||
void loop() { | ||
irsend.sendRaw(buf,25,38); | ||
delay(100); | ||
} |