Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
danielzhu1201 authored Sep 13, 2017
1 parent ec5f04e commit 5dc2ae6
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
41 changes: 41 additions & 0 deletions receive/receive.ino
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();
}
}



15 changes: 15 additions & 0 deletions send/send.ino
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);
}

0 comments on commit 5dc2ae6

Please sign in to comment.