Keyestudio Ks0428 Manual page 118

Table of Contents

Advertisement

www.keyestudio.com
irrecv.enableIRIn(); // Initialize the IR receiver
pinMode(LED_PIN,OUTPUT);//set LED_pin to OUTPUT
}
void loop() {
if (irrecv.decode(&results)) {
if(results.value==0xFF02FD &a==0) // according to the above key
value, press"OK"on remote control , LED will be controlled
{
digitalWrite(LED_PIN,HIGH);//LED will be on
a=1;
}
else if(results.value==0xFF02FD &a==1) //press again
{
digitalWrite(LED_PIN,LOW);//LED will go off
a=0;
}
irrecv.resume(); //receive the next value
}
}
//*******************************************************
Upload code to development board, press"OK"key on remote
control to make LED on and off.
118

Advertisement

Table of Contents
loading

Table of Contents