I'm relatively new to Arduino, and here are what I was trying to do.
I want to control a relay circuit using IR(InfarRet)
remote. Here is the code what I'm using :
#include <IRremote.h>
int RECV_PIN = 6;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
irrecv.enableIRIn();
pinMode (5 ,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if (irrecv.decode(&results)){
Serial.println(results.value,DEC);
irrecv.resume();
switch (results.value){
case 3150073167:
digitalWrite(5,HIGH);
break;
case 68850955:
digitalWrite (5,LOW);
break;
}
}
}
circuit is working properly,
but after power restart it is not working properly, hear is a snap :
how to fix this error ?