#include <IRremote.h>
#define PHOTO 0xB4B8F
IRsend irsend;
void setup() {
Serial.begin(115200);
pinMode(6, OUTPUT);
}
void loop() {
for (int i = 0; i < 3; i++)
{
irsend.sendSony(PHOTO, 20); // Sony code
delay(12);
}
delay(5000);
}
#include <IRremote.h>
#define PHOTO 0xB4B8F
IRsend irsend;
#define pushButton 8
int buttonState, num;
void setup() {
Serial.begin(115200);
pinMode(6, OUTPUT);
pinMode(pushButton, INPUT);
}
void loop() {
buttonState = digitalRead(pushButton);
if (num != buttonState)
{
num = buttonState;
if (num == 0)
{
take();
Serial.println("take");
}
}
}
void take()
{
for (int i = 0; i < 3; i++)
{
irsend.sendSony(PHOTO, 20); // Sony code
delay(12);
}
}
buttonState = digitalRead(pushButton);
if (num != buttonState)
{
num = buttonState;
if (num == 0)
{
take();
Serial.println("take");
}
}