Skip to content

Search the documentation

Kit
Firmware

Led

Smart Car

One of the robot’s lights (led1 or led2); brightness is in percent, 0 to 100.

The Led class is reached through these attributes of robot.

Can be None.

Can be None.

All the attributes of robot are in its table. Read Attributes that can be None to see when a part is None.

Turns the light on at full brightness.

on()

Used in examples: Drive a square, Find north, Song and lights, Name your robot, then drive it, Line follower

Turns the light off.

off()

Used in examples: Drive a square, Find north, Song and lights, Name your robot, then drive it, Line follower

Turns the light off if it is on, and on if it is off.

toggle()

Used in examples: Sensor check

Turns the light on for True (or 1) and off for False (or 0).

set(on)

Used in examples: Find north, Name your robot, then drive it, Line follower

Sets how bright the light is, from 0 (off) to 100 percent.

set_brightness(percent)

Used in examples: Song and lights