Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrdecent08 authored Nov 23, 2020
1 parent 56e7c60 commit 2f66398
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions IR sensor.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include<IRremote.h>
int RECV_PIN =7;
IRrecv irrecv(RECV_PIN);
decode_results results;


void setup()
{
pinMode(2, OUTPUT);
Serial.begin(9600);
Serial.println("Enabling IRin");
irrecv.enableIRIn();
Serial.println("Enabled IRin");
}

void loop()
{
if(irrecv.decode(&results))
{
Serial.println(results.value,HEX);
irrecv.resume();
if(results.value==0xFD08E7)
{
digital.write(2,HIGH);
}
else if(results.value==)xFD8877)
{
digital.write(2,LOW);
}
}
delay(20);
}
Binary file added IR sensor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2f66398

Please sign in to comment.