moved GY33_MCU library to own repository

moved GY33_MCU library to own repository
This commit is contained in:
BPoH_Voodoo
2019-02-04 10:29:20 +01:00
parent a1ac9f2701
commit fe08b3767d
2 changed files with 22 additions and 4 deletions
+2 -2
View File
@@ -8,7 +8,7 @@
// needed for library WiFiManager
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager
#include <WiFiClient.h>
#include <ESP8266mDNS.h>
@@ -20,7 +20,7 @@
#ifdef ENABLE_BUTTON_GY33
// 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
// ***************************************************************************
+19 -1
View File
@@ -129,6 +129,9 @@ void handleSetMainColor(uint8_t * mypayload) {
main_color.green = ((rgb >> 8) & 0xFF);
main_color.blue = ((rgb >> 0) & 0xFF);
// strip.setColor(main_color.red, main_color.green, main_color.blue);
#ifdef ENABLE_TV
exit_func = true;
#endif
prevmode = mode;
mode = SETCOLOR;
}
@@ -147,6 +150,9 @@ void handleSetAllMode(uint8_t * mypayload) {
exit_func = true;
#endif
ws2812fx_mode = FX_MODE_STATIC;
#ifdef ENABLE_TV
exit_func = true;
#endif
mode = SET_MODE;
}
@@ -346,9 +352,12 @@ void handleSetNamedMode(String str_mode) {
#endif
}
void handleSetWS2812FXMode(uint8_t * mypayload) {
mode = SET_MODE;
uint8_t ws2812fx_mode_tmp = (uint8_t) strtol((const char *) &mypayload[1], NULL, 10);
ws2812fx_mode = constrain(ws2812fx_mode_tmp, 0, strip.getModeCount() - 1);
#ifdef ENABLE_TV
exit_func = true;
#endif
mode = SET_MODE;
}
String listStatusJSON(void) {
@@ -474,6 +483,9 @@ void autoTick() {
void handleAutoStart() {
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);
mode = AUTO;
autoCount = 0;
@@ -522,6 +534,9 @@ void checkpayload(uint8_t * payload, bool mqtt = false, uint8_t num = 0) {
if (payload[0] == '?') {
uint8_t d = (uint8_t) strtol((const char *) &payload[1], NULL, 10);
ws2812fx_speed = constrain(d, 0, 255);
#ifdef ENABLE_TV
exit_func = true;
#endif
prevmode = mode;
mode = SETSPEED;
Dbg_Prefix(mqtt, num);
@@ -542,6 +557,9 @@ void checkpayload(uint8_t * payload, bool mqtt = false, uint8_t num = 0) {
if (payload[0] == '%') {
uint8_t b = (uint8_t) strtol((const char *) &payload[1], NULL, 10);
brightness = constrain(b, 0, 255);
#ifdef ENABLE_TV
exit_func = true;
#endif
prevmode = mode;
mode = BRIGHTNESS;
Dbg_Prefix(mqtt, num);