moved GY33_MCU library to own repository
moved GY33_MCU library to own repository
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
// needed for library WiFiManager
|
// needed for library WiFiManager
|
||||||
#include <DNSServer.h>
|
#include <DNSServer.h>
|
||||||
#include <ESP8266WebServer.h>
|
#include <ESP8266WebServer.h>
|
||||||
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager
|
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager
|
||||||
|
|
||||||
#include <WiFiClient.h>
|
#include <WiFiClient.h>
|
||||||
#include <ESP8266mDNS.h>
|
#include <ESP8266mDNS.h>
|
||||||
@@ -17,10 +17,10 @@
|
|||||||
|
|
||||||
#include <WebSockets.h> //https://github.com/Links2004/arduinoWebSockets
|
#include <WebSockets.h> //https://github.com/Links2004/arduinoWebSockets
|
||||||
#include <WebSocketsServer.h>
|
#include <WebSocketsServer.h>
|
||||||
|
|
||||||
#ifdef ENABLE_BUTTON_GY33
|
#ifdef ENABLE_BUTTON_GY33
|
||||||
// needed for MCU
|
// needed for MCU
|
||||||
#include "GY33_MCU.h"
|
#include <GY33_MCU.h> //https://github.com/FabLab-Luenen/GY33_MCU/archive/master.zip ; //https://github.com/pasko-zh/brzo_i2c
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
// Initialize Color Sensor
|
// Initialize Color Sensor
|
||||||
// ***************************************************************************
|
// ***************************************************************************
|
||||||
|
|||||||
@@ -129,6 +129,9 @@ void handleSetMainColor(uint8_t * mypayload) {
|
|||||||
main_color.green = ((rgb >> 8) & 0xFF);
|
main_color.green = ((rgb >> 8) & 0xFF);
|
||||||
main_color.blue = ((rgb >> 0) & 0xFF);
|
main_color.blue = ((rgb >> 0) & 0xFF);
|
||||||
// strip.setColor(main_color.red, main_color.green, main_color.blue);
|
// strip.setColor(main_color.red, main_color.green, main_color.blue);
|
||||||
|
#ifdef ENABLE_TV
|
||||||
|
exit_func = true;
|
||||||
|
#endif
|
||||||
prevmode = mode;
|
prevmode = mode;
|
||||||
mode = SETCOLOR;
|
mode = SETCOLOR;
|
||||||
}
|
}
|
||||||
@@ -147,6 +150,9 @@ void handleSetAllMode(uint8_t * mypayload) {
|
|||||||
exit_func = true;
|
exit_func = true;
|
||||||
#endif
|
#endif
|
||||||
ws2812fx_mode = FX_MODE_STATIC;
|
ws2812fx_mode = FX_MODE_STATIC;
|
||||||
|
#ifdef ENABLE_TV
|
||||||
|
exit_func = true;
|
||||||
|
#endif
|
||||||
mode = SET_MODE;
|
mode = SET_MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,9 +352,12 @@ void handleSetNamedMode(String str_mode) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
void handleSetWS2812FXMode(uint8_t * mypayload) {
|
void handleSetWS2812FXMode(uint8_t * mypayload) {
|
||||||
mode = SET_MODE;
|
|
||||||
uint8_t ws2812fx_mode_tmp = (uint8_t) strtol((const char *) &mypayload[1], NULL, 10);
|
uint8_t ws2812fx_mode_tmp = (uint8_t) strtol((const char *) &mypayload[1], NULL, 10);
|
||||||
ws2812fx_mode = constrain(ws2812fx_mode_tmp, 0, strip.getModeCount() - 1);
|
ws2812fx_mode = constrain(ws2812fx_mode_tmp, 0, strip.getModeCount() - 1);
|
||||||
|
#ifdef ENABLE_TV
|
||||||
|
exit_func = true;
|
||||||
|
#endif
|
||||||
|
mode = SET_MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
String listStatusJSON(void) {
|
String listStatusJSON(void) {
|
||||||
@@ -474,6 +483,9 @@ void autoTick() {
|
|||||||
|
|
||||||
void handleAutoStart() {
|
void handleAutoStart() {
|
||||||
if (mode!=AUTO) {
|
if (mode!=AUTO) {
|
||||||
|
#ifdef ENABLE_TV
|
||||||
|
exit_func = true;
|
||||||
|
#endif
|
||||||
sprintf(beforeauto_state, "STA|%2d|%3d|%3d|%3d|%3d|%3d|%3d|%3d", mode, strip.getMode(), ws2812fx_speed, brightness, main_color.red, main_color.green, main_color.blue, main_color.white);
|
sprintf(beforeauto_state, "STA|%2d|%3d|%3d|%3d|%3d|%3d|%3d|%3d", mode, strip.getMode(), ws2812fx_speed, brightness, main_color.red, main_color.green, main_color.blue, main_color.white);
|
||||||
mode = AUTO;
|
mode = AUTO;
|
||||||
autoCount = 0;
|
autoCount = 0;
|
||||||
@@ -522,6 +534,9 @@ void checkpayload(uint8_t * payload, bool mqtt = false, uint8_t num = 0) {
|
|||||||
if (payload[0] == '?') {
|
if (payload[0] == '?') {
|
||||||
uint8_t d = (uint8_t) strtol((const char *) &payload[1], NULL, 10);
|
uint8_t d = (uint8_t) strtol((const char *) &payload[1], NULL, 10);
|
||||||
ws2812fx_speed = constrain(d, 0, 255);
|
ws2812fx_speed = constrain(d, 0, 255);
|
||||||
|
#ifdef ENABLE_TV
|
||||||
|
exit_func = true;
|
||||||
|
#endif
|
||||||
prevmode = mode;
|
prevmode = mode;
|
||||||
mode = SETSPEED;
|
mode = SETSPEED;
|
||||||
Dbg_Prefix(mqtt, num);
|
Dbg_Prefix(mqtt, num);
|
||||||
@@ -542,6 +557,9 @@ void checkpayload(uint8_t * payload, bool mqtt = false, uint8_t num = 0) {
|
|||||||
if (payload[0] == '%') {
|
if (payload[0] == '%') {
|
||||||
uint8_t b = (uint8_t) strtol((const char *) &payload[1], NULL, 10);
|
uint8_t b = (uint8_t) strtol((const char *) &payload[1], NULL, 10);
|
||||||
brightness = constrain(b, 0, 255);
|
brightness = constrain(b, 0, 255);
|
||||||
|
#ifdef ENABLE_TV
|
||||||
|
exit_func = true;
|
||||||
|
#endif
|
||||||
prevmode = mode;
|
prevmode = mode;
|
||||||
mode = BRIGHTNESS;
|
mode = BRIGHTNESS;
|
||||||
Dbg_Prefix(mqtt, num);
|
Dbg_Prefix(mqtt, num);
|
||||||
|
|||||||
Reference in New Issue
Block a user