-
Notifications
You must be signed in to change notification settings - Fork 0
MiP_ChestLED
Manages MiP's chest LED.
Signature: constexpr uint8_t MIP_CMD_GET_CHEST_LED
MiP protocol command bytes used by the chest LED subsystem.
Details:
These values are placed in the first byte of requests sent to the MiP (and appear in the corresponding responses). See the official MiP BLE Protocol for the complete list.
Signature: constexpr uint8_t MIP_CMD_SET_CHEST_LED
Signature: constexpr uint8_t MIP_CMD_FLASH_CHEST_LED
Signature: MiP_ChestLED(MiP &mip)
Constructs the chest LED manager.
Parameters:
| Parameter | Description |
|---|---|
mip |
A reference to the main MiP object to access core services. |
Signature: void read(MiPChestLED &chestLED)
Reads the current RGB state and flash timings of the chest LED.
Details:
chestLED
A reference to a MiPChestLED object where the retrieved data will be stored.
Parameters:
| Parameter | Description |
|---|---|
chestLED |
A reference to a MiPChestLED object where the retrieved data will be stored. |
Signature: void write(uint8_t red, uint8_t green, uint8_t blue)
Sets the chest LED to a solid RGB color and verifies the change.
Details:
Sends the set command and immediately reads the state back from the MiP to ensure the color was successfully updated. Retries upon failure.
red
Intensity for the red channel (0-255).
green
Intensity for the green channel (0-255).
blue
Intensity for the blue channel (0-255). Note: MiP truncates the lower 2 bits.
Parameters:
| Parameter | Description |
|---|---|
red |
Intensity for the red channel (0-255). |
green |
Intensity for the green channel (0-255). |
blue |
Intensity for the blue channel (0-255). Note: MiP truncates the lower 2 bits. |
Signature: void write(uint8_t red, uint8_t green, uint8_t blue, uint16_t onTime, uint16_t offTime)
Sets the chest LED to flash an RGB color at a specific interval and verifies the change.
Details:
red
Intensity for the red channel (0-255).
green
Intensity for the green channel (0-255).
blue
Intensity for the blue channel (0-255).
onTime
Time in milliseconds the LED stays on. (Converted internally to 20ms ticks).
offTime
Time in milliseconds the LED stays off. (Converted internally to 20ms ticks).
Parameters:
| Parameter | Description |
|---|---|
red |
Intensity for the red channel (0-255). |
green |
Intensity for the green channel (0-255). |
blue |
Intensity for the blue channel (0-255). |
onTime |
Time in milliseconds the LED stays on. (Converted internally to 20ms ticks). |
offTime |
Time in milliseconds the LED stays off. (Converted internally to 20ms ticks). |
Signature: void write(const MiPChestLED &chestLED)
Sets the chest LED to flash an RGB color at a specific interval and verifies the change.
Details:
chestLED
A MiPChestLED instance.
Parameters:
| Parameter | Description |
|---|---|
chestLED |
A MiPChestLED instance. |
Signature: void unverifiedWrite(uint8_t red, uint8_t green, uint8_t blue)
Sets the chest LED to a solid RGB color without verifying the change.
Details:
This is a "fire-and-forget" method. It sends the command but does not read back the state to check for success, making it faster but less reliable than writeChestLED().
red
Intensity for the red channel (0-255).
green
Intensity for the green channel (0-255).
blue
Intensity for the blue channel (0-255).
Parameters:
| Parameter | Description |
|---|---|
red |
Intensity for the red channel (0-255). |
green |
Intensity for the green channel (0-255). |
blue |
Intensity for the blue channel (0-255). |
Signature: void unverifiedWrite(uint8_t red, uint8_t green, uint8_t blue, uint16_t onTime, uint16_t offTime)
Sets the chest LED to a solid RGB color without verifying the change.
Details:
This is a "fire-and-forget" method. It sends the command but does not read back the state to check for success, making it faster but less reliable than writeChestLED().
red
Intensity for the red channel (0-255).
green
Intensity for the green channel (0-255).
blue
Intensity for the blue channel (0-255).
onTime
Time in milliseconds the LED stays on. (Converted internally to 20ms ticks).
offTime
Time in milliseconds the LED stays off. (Converted internally to 20ms ticks).
Parameters:
| Parameter | Description |
|---|---|
red |
Intensity for the red channel (0-255). |
green |
Intensity for the green channel (0-255). |
blue |
Intensity for the blue channel (0-255). |
onTime |
Time in milliseconds the LED stays on. (Converted internally to 20ms ticks). |
offTime |
Time in milliseconds the LED stays off. (Converted internally to 20ms ticks). |
Signature: void unverifiedWrite(const MiPChestLED &chestLED)
Sets the chest LED to a solid RGB color without verifying the change.
Details:
This is a "fire-and-forget" method. It sends the command but does not read back the state to check for success, making it faster but less reliable than writeChestLED().
chestLED
An instance of MiPChestLED.
Parameters:
| Parameter | Description |
|---|---|
chestLED |
An instance of MiPChestLED. |
- MiP
- MiPChestLED
- MiPClapSettings
- MiPDebug
- MiPHardwareInfo
- MiPHeadLEDs
- MiPIRDongleCode
- MiPSoftwareVersion
- MiPStatus
- MiP_Battery
- MiP_ChestLED
- MiP_Clap
- MiP_EEPROM
- MiP_Gesture
- MiP_HeadLEDs
- MiP_Infrared
- MiP_Mode
- MiP_Motion
- MiP_Odometer
- MiP_Position
- MiP_Radar
- MiP_Serial
- MiP_Shake
- MiP_Sound
- MiP_Version
- MiP_Weight
- MiP_WiFi