Skip to content

MiP_ChestLED

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

Class MiP_ChestLED

MiP_ChestLED provides functions to read from and write to MiP's chest LED, allowing the setting of color and flash time.

Public Elements

MIP_CMD_GET_CHEST_LED

Signature: constexpr uint8_t MIP_CMD_GET_CHEST_LED

Summary: The MiP protocol command to read the chest LED color.


MIP_CMD_SET_CHEST_LED

Signature: constexpr uint8_t MIP_CMD_SET_CHEST_LED

Summary: The MiP protocol command to set the chest LED color.


MIP_CMD_FLASH_CHEST_LED

Signature: constexpr uint8_t MIP_CMD_FLASH_CHEST_LED

Summary: The MiP protocol command to flash the chest LED.


MiP_ChestLED

Signature: MiP_ChestLED(MiP &mip)

Summary: 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)

Summary: 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)

Summary: 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)

Summary: 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)

Summary: 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)

Summary: 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)

Summary: 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)

Summary: 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