hi!
I need your help with a small program.
I want to do is push a button that turns on an LED, and when you stop pressing goes, I’m using the library <NECIRrcv.h>
I’m making a change in this program, but still no success.
#include <Arduino.h>
#include <NECIRrcv.h>
#define IRPIN 11
int rele = 8;
int rele2 = 9;
static int aux = 1;
NECIRrcv ir(IRPIN) ;
void setup()
{
pinMode(rele, OUTPUT);
pinMode(rele2, OUTPUT);
ir.begin() ;
}
void loop()
{
unsigned long ircode ;
while (ir.available()) {
ircode = ir.read() ;
if(ircode == 3540682734){
if(aux == 0){
digitalWrite(rele, LOW);
aux = 1;
}
else{
digitalWrite(rele, HIGH);
aux = 0;
}
}
and hope you can help me, thanks.