ESP_IOT v2.5
IOT ESP Coding
KeyUnitSensorClass.h
Go to the documentation of this file.
1#ifndef KeyUnitSensorClass_h
2#define KeyUnitSensorClass_h
3#include "../../Defines.h"
4#if defined(ESP_M5) && !defined(ESP_M5_MINIMAL_SENSORS)
5#include "SensorClassType.h"
6#ifdef USE_FAST_LED
7#include <FastLED.h>
8#endif
9
10//!@see https://forum.arduino.cc/t/undefined-reference-to-vtable-for-abstract-classname-even-after-derived-class-definition/1084221/6
11
13{
14public:
15 //! constructor
16 KeyUnitSensorClass(char *config);
17
18//! destructor
20
21 //! Pure Virtual Function
22 void loop();
23
24 //! Pure Virtual Function
25 void setup();
26
27 //! 2.21.24 change color made public
28 //! hope to call on FEED message received..
29 void changeLedColor();
30
31#ifdef NOT_DEFINED
32
33 //! adding the messages as well
34 //! 5.14.25 (Laura/Paul flying). 5.14.74 great Dead
35 //! 8.28.23 Adding a way for others to get informed on messages that arrive
36 //! for the set,val
37 //! 12.27.23 support setName == "socket"
38 //! 1.10.24 if deviceNameSpecified then this matches this device, otherwise for all.
39 //! It's up to the receiver to decide if it has to be specified
40 void messageSetVal_SensorClassType(char *setName, char* valValue, boolean deviceNameSpecified);
41
42 //! 12.28.23, 8.28.23 Adding a way for others to get informed on messages that arrive
43 //! for the send -
44 void messageSend_SensorClassType(char *sendValue);
45
46 //! 12.28.23, 8.28.23 Adding a way for others to get informed on messages that arrive
47 //! for the cmd
48 void messageCmd_SensorClassType(char *cmdValue);
49#endif
50
51private:
52 void keyUnitLED();
53
54
55 //!setup the KeyUnit
56 void setupKeyUnit();
57
58 //! loop the key unit (after other called M5.updfate)
59 void loopKeyUnit();
60
61 //! static wrapper class
62 static void startTaskImpl(void*);
63
64 //! these are not initialized...
65 int _scotty = 100;
66 uint8_t _ledColor = 0;
67 CRGB *_leds; // Define the array of leds. 定义LED阵列.
68};
69#endif
70#endif
KeyUnitSensorClass(char *config)
constructor
void setup()
Pure Virtual Function.
~KeyUnitSensorClass()
destructor
void loop()
Pure Virtual Function.
virtual void messageCmd_SensorClassType(char *cmdValue)
virtual void messageSend_SensorClassType(char *sendValue)
virtual void messageSetVal_SensorClassType(char *setName, char *valValue, boolean deviceNameSpecified)