#include <IRremote.h> // >v3.0.0
#define PIN_SEND 3
const int buttonPin_1 = 5;
int buttonState_1 = LOW;
int Contact_1 = 0;
int Contact1 = 0;
int count = 0;
long lastDebounceTime = 0;
long debounceDelay =120;
void setup()
{
pinMode(buttonPin_1, INPUT);
digitalRead(buttonPin_1);
IrSender.begin(PIN_SEND); // Initializes IR sender
}
void loop()
{
buttonState_1 = digitalRead(buttonPin_1);
millis()-lastDebounceTime > debounceDelay;
if (buttonState_1 == HIGH && (count < 2)){IrSender.sendNEC(0x0102, 12, 0);count = count +1;
lastDebounceTime = millis();}
if (buttonState_1 == LOW){count = count -2;
lastDebounceTime = millis();}
}