Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define BLYNK_PRINT Serial
- #include <ESP8266_Lib.h>
- #include <BlynkSimpleShieldEsp8266.h>
- #include <RCSwitch.h>
- #include <SimpleTimer.h>
- #define LEDGRUEN #7CFC00
- #define LEDROT #B22222
- #define LEDGRAU #808080
- long signalCode;
- byte vetlilkoerper1Stand = 0;
- byte vetlilkoerper1AltStand = 0;
- bool ventilkoerper1Gemeldet = false;
- #define VERTILKOERPER1NAMEVPIN V1
- #define VENTILKOERPER1LEDVPIN V2
- #define VENTILKOERPER1MELUNGVPIN V3
- byte vetlilkoerper2Stand = 0;
- byte vetlilkoerper2AltStand = 0;
- bool ventilkoerper2Gemeldet = false;
- #define VERTILKOERPER2NAMEVPIN V4
- #define VENTILKOERPER2LEDVPIN V5
- #define VENTILKOERPER2MELUNGVPIN V6
- byte nelaStand = 0; //lauft - 15932898 stoerung - 15932900
- byte nelaAltStand = 0;
- bool nelaGemeldet = false;
- #define NELANAMEVPIN V7
- #define NELALEDVPIN V8
- #define NELAMELUNGVPIN V9
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- WidgetLED ventilkoperper1Led(VENTILKOERPER1LEDVPIN);
- WidgetLED ventilkoperper2Led(VENTILKOERPER2LEDVPIN);
- WidgetLED nelaLed(NELALEDVPIN);
- SimpleTimer timer;
- RCSwitch mySwitch = RCSwitch();
- char auth[] = "----------------------";
- char ssid[] = "BlynkServer";
- char pass[] = "1234567890";
- #define EspSerial Serial1
- #define ESP8266_BAUD 115200
- ESP8266 wifi(&EspSerial);
- void setup()
- {
- Serial.begin(9600);
- mySwitch.enableReceive(0); // Receiver on interrupt 0 => that is pin #2
- EspSerial.begin(ESP8266_BAUD);
- delay(10);
- timer.setInterval(5000, debuging);
- Blynk.begin(auth, wifi, ssid, pass,"192.168.5.1", 8080);
- }
- void loop()
- {
- Blynk.run();
- timer.run();
- if (mySwitch.available()) {
- Serial.println( mySwitch.getReceivedValue() );
- signalCode = mySwitch.getReceivedValue();
- if(signalCode==15932898)
- {nelaStand=1; Blynk.setProperty(NELALEDVPIN, "color", "#7CFC00"); nelaLed.on();}
- if(signalCode==15932900){nelaStand=2; Blynk.setProperty(NELALEDVPIN, "color", "#B22222"); meldung();}
- mySwitch.resetAvailable();
- }
- }
- void meldung()
- {
- Blynk.notify("Nela steht! Überprüfen!");
- }
- void debuging()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement