Serial control enabled

This commit is contained in:
Ollo 2024-12-06 22:53:34 +01:00
parent f761d3349e
commit 365d8c987a

View File

@ -5,6 +5,8 @@
#include <Adafruit_NeoPixel.h>
#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);