Tuesday, January 9, 2024

Удирдлагаар лед асааж унтраах

 


#include <IRremote.h>


const byte IR_PIN = 12;


void setup()
{
  Serial.begin(9600);
  IrReceiver.begin(IR_PIN);
  pinMode(13, OUTPUT);
}

void loop()
{
  if (IrReceiver.decode())
  {
    Serial.println(IrReceiver.decodedIRData.command);
    IrReceiver.resume();
   
    if(IrReceiver.decodedIRData.command == 12){
      digitalWrite(13, HIGH);
      }
   
    else if(IrReceiver.decodedIRData.command == 24){
      digitalWrite(13, LOW);
     
    }
       
  }

}

No comments:

Post a Comment