cleanup
This commit is contained in:
parent
015607d2a9
commit
3e4c3f3461
@ -1,5 +1,6 @@
|
||||
#if DHT_SENSOR
|
||||
|
||||
#include <Adafruit_Sensor.h>
|
||||
#include <DHT.h>
|
||||
|
||||
#define DHT11_PIN 12
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
#include <RCSwitch.h>
|
||||
|
||||
class Protocol {
|
||||
private:
|
||||
|
||||
unsigned int protocol;
|
||||
|
||||
public:
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
#include <Arduino.h>
|
||||
#include <RCSwitch.h>
|
||||
#include <Adafruit_Sensor.h>
|
||||
#include "Tiny.h"
|
||||
#include <ArduinoJson.h>
|
||||
#include "Dht.h"
|
||||
#include "Protocol_1.h"
|
||||
#include "Protocol_2.h"
|
||||
@ -14,9 +11,6 @@
|
||||
|
||||
RCSwitch mySwitch = RCSwitch();
|
||||
|
||||
void readRcSwitch();
|
||||
void readCommand();
|
||||
|
||||
void setup() {
|
||||
digitalWrite(RESET_PIN, HIGH);
|
||||
pinMode(LED_BUILTIN, OUTPUT);
|
||||
@ -33,12 +27,6 @@ void setup() {
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
readCommand();
|
||||
readRcSwitch();
|
||||
Dht::read();
|
||||
}
|
||||
|
||||
Protocol findProtocol(unsigned int protocol) {
|
||||
switch (mySwitch.getReceivedProtocol()) {
|
||||
case 1:
|
||||
@ -107,3 +95,9 @@ void readCommand() {
|
||||
runJsonCommands(cmd.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void loop() {
|
||||
readCommand();
|
||||
readRcSwitch();
|
||||
Dht::read();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user