Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (17 sloc) 1.71 KB
// AC controller through IR commands by Bogdan Argatu
int buton1 = 7;
#include <IRremote.h>
IRsend irsend;
void setup() {
pinMode(buton1,INPUT_PULLUP);
Serial.begin(9600);
}
void loop() {
int khz = 38; // 38kHz carrier frequency
if (digitalRead(buton1) == LOW)
{
unsigned int irSignal[] = {3072, 1592, 516, 1064, 516, 1040, 536, 308, 512, 308, 508, 332, 488, 1068, 508, 336, 516, 300, 516, 1064, 516, 1064, 512, 304, 516, 1064, 512, 332, 508, 312, 516, 1064, 512, 1068, 512, 304, 516, 1064, 512, 1068, 520, 300, 520, 324, 484, 1096, 512, 304, 512, 304, 516, 1064, 512, 332, 508, 312, 508, 308, 512, 332, 504, 312, 508, 308, 512, 332, 516, 300, 516, 328, 484, 332, 516, 300, 520, 296, 512, 332, 516, 304, 516, 324, 512, 304, 516, 304, 516, 1060, 516, 328, 492, 328, 508, 1072, 508, 308, 512, 332, 484, 1096, 484, 332, 516, 304, 516, 300, 516, 328, 512, 304, 516, 300, 516, 328, 512, 1068, 508, 1072, 508, 1072, 516, 300, 516, 304, 516, 328, 512, 304, 516, 328, 488, 1064, 516, 328, 488, 1092, 508, 308, 508, 308, 512, 332, 488, 332, 516, 300, 508, 336, 512, 304, 516, 300, 512, 332, 516, 300, 516, 300, 508, 336, 516, 300, 516, 328, 480, 336, 516, 300, 516, 328, 484, 332, 516, 300, 516, 328, 484, 336, 512, 304, 512, 328, 512, 308, 512, 304, 516, 328, 508, 308, 512, 304, 516, 328, 508, 308, 512, 332, 488, 328, 508, 308, 512, 304, 516, 328, 508, 308, 512, 332, 508, 308, 512, 1068, 516, 1064, 516, 304, 516, 300, 516, 328, 512, 1068, 508, 308, 512 }; //AnalysIR Batch Export (IRremote) - RAW
irsend.sendRaw(irSignal, sizeof(irSignal) / sizeof(irSignal[0]), khz); //Note the approach used to automatically calculate the size of the array.
delay(3000); //In this example, the signal will be repeated every 3 seconds, approximately.
}
}
You can’t perform that action at this time.