Created
May 29, 2019 10:20
-
-
Save KornWtp/ab3daeec9288ede0f396fa5814dfdad8 to your computer and use it in GitHub Desktop.
remote_air_diy.io
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Arduino.h> | |
| #include <DYIRDaikin.h> | |
| #define DYIRDAIKIN_SOFT_IR | |
| DYIRDaikin irdaikin; | |
| int isOn; | |
| void setup() | |
| { | |
| Serial.begin(115200); | |
| #ifdef DYIRDAIKIN_SOFT_IR | |
| irdaikin.begin(5); | |
| #else | |
| irdaikin.begin(); | |
| #endif | |
| irdaikin.on(); | |
| irdaikin.setSwing_off(); | |
| irdaikin.setMode(1); | |
| irdaikin.setFan(4);//FAN speed to MAX | |
| irdaikin.setTemp(25); | |
| // ----everything is ok and to execute send command----- | |
| irdaikin.sendCommand(); | |
| isOn = 0; | |
| } | |
| void loop() { | |
| while (Serial.available() > 0) { | |
| if (Serial.read() == '\n') { | |
| if (isOn == 0){ | |
| isOn = 1; | |
| irdaikin.off(); | |
| Serial.println("Turn Off"); | |
| }else{ | |
| isOn = 0; | |
| irdaikin.on(); | |
| Serial.println("Turn On"); | |
| } | |
| irdaikin.sendCommand(); | |
| Serial.println("Execute Command!"); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment