This commit is contained in:
Nicu Hodos 2022-10-26 09:52:37 +02:00
parent 015607d2a9
commit 3e4c3f3461
3 changed files with 8 additions and 13 deletions

View File

@ -1,5 +1,6 @@
#if DHT_SENSOR
#include <Adafruit_Sensor.h>
#include <DHT.h>
#define DHT11_PIN 12

View File

@ -3,7 +3,7 @@
#include <RCSwitch.h>
class Protocol {
private:
unsigned int protocol;
public:

View File

@ -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();
}