Led
Smart CarOne of the robot’s lights (led1 or led2); brightness is in percent, 0 to 100.
How you reach it
Section titled “How you reach it”The Led class is reached through these attributes of robot.
robot.led1
Section titled “robot.led1”Can be None.
robot.led2
Section titled “robot.led2”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.
Methods
Section titled “Methods”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
toggle()
Section titled “toggle()”Turns the light off if it is on, and on if it is off.
toggle()Used in examples: Sensor check
set(on)
Section titled “set(on)”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
set_brightness(percent)
Section titled “set_brightness(percent)”Sets how bright the light is, from 0 (off) to 100 percent.
set_brightness(percent)Used in examples: Song and lights