Bigroom esp32

This commit is contained in:
2022-03-14 13:05:34 +03:00
parent 8b6684deb0
commit f87f56292f
11 changed files with 714 additions and 167 deletions

View File

@@ -1,18 +1,50 @@
// #ifndef __MAIN__
// #define __MAIN__
#ifndef __MAIN__
#define __MAIN__
// #include <Arduino.h>
// #include <ArduinoOTA.h>
// #include <Ticker.h>
// #include <AsyncMqttClient.h>
// #include "Adafruit_HTU21DF.h"
#include <Arduino.h>
#include <ArduinoOTA.h>
#include <Ticker.h>
#include <WiFi.h>
extern "C" {
#include "freertos/FreeRTOS.h"
#include "freertos/timers.h"
}
#include <AsyncMqttClient.h>
#include <leds.h>
#include "MHZ19.h"
#include <Wire.h>
//#include "HTU21D.h"
#include <RunningMedian.h>
#include <Adafruit_HTU21DF.h>
#include <EEPROM.h>
// #define R_LED GPIO0
// #define G_LED GPIO2
// #define B_LED GPIO14
#define BAUDRATE 9600
// bool meas = false;
// short minCnt;
#define LIGHT_SENS 36 //VP
#define MOVE_SENS 39 //VN
// #endif // __MAIN__
#define LED_WHITE 25 //25
#define PWM_WHITE 0
#define LED_BLUE 26 //26
#define PWM_BLUE 1
#define POWER 27 //27
#define TXD2 17
#define RXD2 16
#define LED_R 13
#define LED_G 15
#define LED_B 2
#define TOPIC "home/bigroom/"
byte periodMotion;
int8_t curDelay;
uint16_t spLight, dbLight;
uint8_t timeLight;
byte levelBlue, levelWhite;
bool move, lightWhite;
float temp, hum;
bool bLamp, wLamp;
uint8_t statLamp;
#endif // __MAIN__