diff --git a/src/main.cpp b/src/main.cpp index 9622c7d..2ebc2c3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,6 +5,8 @@ #include #include "ColorUtil.h" #include "controller.h" +#include "SerialCmd.h" + /****************************************************************************** * MACROS ******************************************************************************/ @@ -78,6 +80,9 @@ void setup() { Serial.println(F("\nWifi mode is WIFI_OFF")); } + + SerialCmd_clearCmdArray(); + #ifdef FAN_ENABLED /* Setup FAN Control */ pinMode(FAN_PIN, OUTPUT); @@ -170,9 +175,31 @@ void loop() i = 0; } - pixels->fill(Color(255, 0,0)); - pixels->setBrightness(actualFanSpeedRpm); + int readCharacter = SerialCmd_readFromSerial(); + + if (readCharacter > 0) + { + int checkCmd = SerialCmd_checkCmdArrayForPrefix(); + + if(checkCmd == 0) + { + Serial.println("if you dont know what to do type \"ollpehelp\""); + } + else + { + char type = SerialCmd_type(); + switch (type) + { + case 'a': + uint32_t color = SerialCmd_parseColor(6); + pixels->fill(color); + pixels->setBrightness(200); + break; + } + } + } pixels->show(); + #else RainbowCycle(pixels, &mRainbowIndex); Serial.print(mRainbowIndex);