Brick lights

Brick lights are another useful way to provide visual feedback from your robot. Coordinating the color of the brick with other parts of your program can be interesting. In the following code, the color of the brick is dependent on the value of the Color Sensor. If the Color Sensor detects black, the brick will be orange. If the Color Sensor detects white, the brick will glow green. Otherwise, by default, if the sensor detects anything other than black or white, the brick will glow red, as shown in the following screenshot:

Brick lights

This allows for a cool-looking EV3 brick, and allows your robot to visually display information that can be seen ...

Get Learning LEGO MINDSTORMS EV3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.