4#include "../../defines.h"
5#if defined(ESP_M5) && !defined(ESP_M5_MINIMAL_SENSORS)
16#include <M5StickCPlus.h>
25 printf(
"KeyUnitSensorClass init %s\n", config);
33 printf(
"KeyUnitSensorClass destroy\n");
56#ifdef ATOM_QRCODE_MODULE
79void KeyUnitSensorClass::startTaskImpl(
void* _this)
81 SerialDebug.printf(
" startTaskImpl == %p\n", _this);
89#ifdef ATOM_QRCODE_MODULE
107void KeyUnitSensorClass::setupKeyUnit()
109 SerialDebug.printf(
"KeyUnitSensorClass.setupKeyUnit == %p\n",
this);
122 FastLED.addLeds<SK6812, 26, GRB>(this->_leds, 1);
129 FastLED.addLeds<SK6812, 23, GRB>(this->_leds, 1);
141 &this->startTaskImpl,
"led", 2024,
this, 0,
148void KeyUnitSensorClass::loopKeyUnit()
153 SerialDebug.println(
"KeyUnitSensorClass.Key Pressed");
161 SerialDebug.println(
"KU.Key Released");
172void KeyUnitSensorClass::keyUnitLED() {
174 SerialDebug.printf(
" setupKeyUnit %p\n",
this);
176 _leds[0] = CRGB::Red;
178 for (
int i = 0; i < 255; i++)
181 FastLED.setBrightness(i);
185 for (
int i = 255; i > 0; i--)
188 FastLED.setBrightness(i);
198 SerialDebug.println(
"changeLedColor");
200 if (_ledColor > 2) _ledColor = 0;
204 _leds[0] = CRGB::Red;
207 _leds[0] = CRGB::Green;
210 _leds[0] = CRGB::Blue;
230 printf(
"KeyUnitSensorClass::setup()\n");
void registerPinUse_mainModule(long pin, String pinName, String moduleName, boolean isI2C)
boolean getPreferenceBoolean_mainModule(int preferenceID)
called to set a preference (which will be an identifier and a string, which can be converted to a num...
#define PREFERENCE_STEPPER_FACTORY_CLOCKWISE_MOTOR_DIRECTION_SETTING
KeyUnitSensorClass(char *config)
constructor
void setup()
Pure Virtual Function.
~KeyUnitSensorClass()
destructor
void loop()
Pure Virtual Function.
virtual void messageCmd_SensorClassType(char *cmdValue)
void callCallback(char *info, boolean flag)
call the callback
virtual void messageSend_SensorClassType(char *sendValue)
virtual void messageSetVal_SensorClassType(char *setName, char *valValue, boolean deviceNameSpecified)
virtual void messageLocal_SensorClassType(char *message)
5.15.25 try a special command local to this class