Notifications using pixel control.
More...
#include <SimWheelTypes.hpp>
|
| uint8_t | getPixelCount (PixelGroup group) |
| | Get the count of pixels in a pixel group.
|
| |
| void | set (PixelGroup group, uint8_t pixelIndex, uint8_t red, uint8_t green, uint8_t blue) |
| | Set the color of a single pixel.
|
| |
| void | setAll (PixelGroup group, uint8_t red, uint8_t green, uint8_t blue) |
| | Set the color of all pixels in a group.
|
| |
| void | shiftToNext (PixelGroup group) |
| | Shift all pixel colors to the next pixel index.
|
| |
| void | shiftToPrevious (PixelGroup group) |
| | Shift all pixel colors to the previous pixel index.
|
| |
| virtual bool | renderBatteryLevel (PixelGroup group, bool colorGradientOrPercentage, uint32_t barColor=0x00ACFA70) |
| | Macro to render the current battery SoC.
|
| |
| uint32_t | frameTimer (uint32_t &timerVariable, uint32_t elapsedTimeMs, uint32_t timeLimitMs) |
| | Simple timer.
|
| |
Notifications using pixel control.
- Note
- All methods are called in a separate low-priority thread
Definition at line 1247 of file SimWheelTypes.hpp.
◆ PixelControlNotification()
| PixelControlNotification::PixelControlNotification |
( |
| ) |
|
|
inlineprotected |
◆ ~PixelControlNotification()
| virtual PixelControlNotification::~PixelControlNotification |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ getInstance()
Get the singleton instance.
- Returns
- PixelControlNotification* Singleton instance
Definition at line 1357 of file SimWheelTypes.hpp.
◆ getPixelCount()
| uint8_t PixelControlNotification::getPixelCount |
( |
PixelGroup | group | ) |
|
|
protected |
Get the count of pixels in a pixel group.
- Parameters
-
- Returns
- uin8_t The count of pixels or zero if the group was not configured.
◆ pixelControl_OnBitePoint()
| virtual void PixelControlNotification::pixelControl_OnBitePoint |
( |
uint8_t | bitePoint | ) |
|
|
virtual |
Notify a change in current bite point.
- Parameters
-
| bitePoint | Last known bite point. |
◆ pixelControl_OnBLEdiscovering()
| virtual void PixelControlNotification::pixelControl_OnBLEdiscovering |
( |
| ) |
|
|
virtual |
Notify device is in discovery mode.
- Note
- Not called in the USB implementation.
◆ pixelControl_OnConnected()
| virtual void PixelControlNotification::pixelControl_OnConnected |
( |
| ) |
|
|
virtual |
Notify device is connected.
- Note
- Called in a low priority thread.
◆ pixelControl_OnLowBattery()
| virtual void PixelControlNotification::pixelControl_OnLowBattery |
( |
| ) |
|
|
virtual |
Notify low battery.
- Note
- Called at timed intervals while the low battery condition persists.
◆ renderBatteryLevel()
| virtual bool PixelControlNotification::renderBatteryLevel |
( |
PixelGroup | group, |
|
|
bool | colorGradientOrPercentage, |
|
|
uint32_t | barColor = 0x00ACFA70 ) |
|
protectedvirtual |
Macro to render the current battery SoC.
- Note
- Does nothing if there is no battery. Pixels are rendered, but not shown yet.
- Parameters
-
| group | A group of pixels |
| colorGradientOrPercentage | If true, show SoC as a color gradient from green to red If false, show SoC as a percentage bar |
| barColor | Packed RGB color to use in the percentage bar. |
- Returns
- True if there is a battery.
-
False if there is no battery.
◆ set()
| void PixelControlNotification::set |
( |
PixelGroup | group, |
|
|
uint8_t | pixelIndex, |
|
|
uint8_t | red, |
|
|
uint8_t | green, |
|
|
uint8_t | blue ) |
|
protected |
Set the color of a single pixel.
- Note
- Not displayed immediately
-
Non-existing pixels will be ignored
- Parameters
-
| group | The group to which the pixel is a member |
| pixelIndex | Index of the pixel in the LED strip (zero-based) |
| red | Red component of the pixel color |
| green | Green component of the pixel color |
| blue | Blue component of the pixel color |
◆ setAll()
| void PixelControlNotification::setAll |
( |
PixelGroup | group, |
|
|
uint8_t | red, |
|
|
uint8_t | green, |
|
|
uint8_t | blue ) |
|
protected |
Set the color of all pixels in a group.
- Parameters
-
| group | A group of pixels |
| red | Red component of the pixel color |
| green | Green component of the pixel color |
| blue | Blue component of the pixel color |
◆ shiftToNext()
| void PixelControlNotification::shiftToNext |
( |
PixelGroup | group | ) |
|
|
protected |
Shift all pixel colors to the next pixel index.
- Parameters
-
◆ shiftToPrevious()
| void PixelControlNotification::shiftToPrevious |
( |
PixelGroup | group | ) |
|
|
protected |
Shift all pixel colors to the previous pixel index.
- Parameters
-
◆ notConnectedYet
| bool PixelControlNotification::notConnectedYet = true |
|
protected |
Flag to indicate host connection.
- Note
- True on startup or connection loss. False after a connection is established. For read only. Do not overwrite.
Definition at line 1275 of file SimWheelTypes.hpp.
The documentation for this class was generated from the following file: