37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <IRremoteESP8266.h>
|
|
#include <IRsend.h>
|
|
|
|
class IRLight {
|
|
private:
|
|
bool state;
|
|
IRsend *irsend;
|
|
|
|
const uint16_t rawDataOn[67] = {
|
|
8980, 4420, 580, 520, 630, 470, 630, 520, 580, 520, 630, 470,
|
|
630, 520, 580, 520, 630, 1570, 630, 1620, 580, 1620, 630, 1620,
|
|
580, 1570, 680, 1570, 630, 1570, 630, 1570, 630, 520, 630, 1570,
|
|
630, 470, 630, 520, 630, 470, 630, 470, 630, 470, 680, 470,
|
|
630, 470, 630, 520, 630, 1570, 630, 1570, 630, 1620, 630, 1570,
|
|
630, 1570, 630, 1570, 680, 1570, 630};
|
|
|
|
const uint16_t rawDataOff[67] = {
|
|
8980, 4370, 680, 420, 730, 420, 680, 420, 680, 420, 730, 420,
|
|
680, 420, 680, 420, 730, 1470, 730, 1520, 680, 1520, 730, 1470,
|
|
730, 1470, 730, 1520, 680, 1520, 730, 1470, 730, 420, 680, 470,
|
|
680, 1470, 730, 420, 680, 1520, 730, 1470, 730, 420, 680, 420,
|
|
680, 470, 580, 1620, 630, 470, 630, 1570, 630, 520, 580, 520,
|
|
630, 1570, 680, 1520, 730, 1520, 680};
|
|
|
|
public:
|
|
IRLight(int pin);
|
|
IRLight(IRsend *irsend);
|
|
void on();
|
|
void off();
|
|
void begin();
|
|
|
|
bool getState();
|
|
|
|
~IRLight();
|
|
}; |