-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStudio_AC_Remote.ino
28 lines (26 loc) · 2.14 KB
/
Studio_AC_Remote.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/***
IR Transmitter.ino
***/
#include<IRremote.h>
IRsend irsend;
// Raw ON code
unsigned int on[199]={4388,4368,560,1616,564,552,540,1640,536,556,540,552,540,552,544,548,532,1648,540,1640,536,556,540,1640,536,556,536,556,536,556,540,552,540,552,540,556,540,1640,536,1640,536,556,540,1640,536,1640,536,1640,536,1644,532,1652,536,1612,564,1612,564,1616,564,1612,564,1612,564,1612,564,1612,564,1620,568,1608,560,1616,560,1616,560,1620,556,1620,560,1616,560,1616,560,560,532,1644,536,556,536,556,536,556,540,552,540,552,540,1640,540,5196,4440,4324,568,552,560,1620,568,528,564,1612,564,1584,596,1608,568,1580,596,524,568,528,568,1612,564,528,564,1616,560,1588,592,1612,564,1584,592,1588,588,1592,596,524,560,532,560,1612,564,532,564,528,564,524,568,528,568,524,568,524,572,520,560,532,564,528,564,528,564,528,568,524,568,528,564,528,568,524,568,524,560,532,560,532,564,528,564,528,564,1620,568,524,560,1620,568,1580,596,1580,596,1584,596,1580,592,528,536};
// Raw OFF code
unsigned int off[199]={4436,4348,560,1616,560,560,536,1644,540,552,532,560,532,560,536,556,536,1640,536,560,536,556,536,1640,536,556,540,552,540,552,544,548,532,564,532,560,532,1648,540,1612,564,552,540,1640,540,1612,564,1612,564,1612,564,1620,568,1608,560,1616,560,1616,560,1620,556,1616,560,1616,564,1616,560,1620,568,1608,568,1608,568,1608,568,1608,568,1608,572,1604,560,1620,568,1616,560,1616,560,556,540,552,540,552,540,552,532,564,532,1644,540,5196,4436,4328,568,552,564,1616,560,532,560,1620,568,1580,588,1588,588,1588,588,532,564,1612,564,1588,588,528,564,1616,564,1588,588,1588,588,1588,588,1588,588,1596,592,524,572,520,560,1616,564,528,564,528,564,528,568,524,568,528,564,528,568,524,560,528,564,528,564,528,568,524,568,524,568,528,568,524,568,524,560,532,560,532,564,524,568,528,564,528,568,524,568,524,560,1620,568,1608,568,1580,596,1580,596,1580,588,536,536};
int KHz = 38;
bool turnOn = true;
void setup()
{
Serial.begin(115200); // begin serial communication with baud rate 9600
}
void loop()
{
Serial.println(turnOn);
if (turnOn) {
irsend.sendRaw(on, 199, KHz); // ON
} else {
irsend.sendRaw(off, 199, KHz); // OFF
}
turnOn = !turnOn;
delay(3000);
}