Skip to content

MiP_ChestLED

github-actions[bot] edited this page Aug 10, 2026 · 11 revisions

Class MiP_ChestLED

Manages MiP's chest LED.

Public Members & Functions

MIP_CMD_GET_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.


MIP_CMD_SET_CHEST_LED

Signature: constexpr uint8_t MIP_CMD_SET_CHEST_LED


MIP_CMD_FLASH_CHEST_LED

Signature: constexpr uint8_t MIP_CMD_FLASH_CHEST_LED


MiP_ChestLED

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.

read

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.

write

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.

write

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).

write

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.

unverifiedWrite

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).

unverifiedWrite

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).

unverifiedWrite

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.

Clone this wiki locally