The BLOCKS SDK
Controlling LED strips

Control Blocks have a strip of LEDs which can be controlled via an LEDRow object.

A pointer to an LEDRow object can be obtained from the Block::getLEDRow method of a Block—see the Discovering BLOCKS section for details of how to obtain a Block object. Once you have an LEDRow there are a few functions that you can use to interact with the strip of LEDs on a device. A code snippet showing how to turn the whole strip of LEDs on a Block orange is shown below.

void setWholeLEDRowOrange (Block& block)
{
if (auto ledRow = block->getLEDRow())
for (int i = 0; i < ledRow.getNumLEDs(); ++i)
ledRow.setLEDColour (i, Colours::orange);
}