LED Bumper#
Introduction#
The LED Bumper can change the color of its LED and detect when it is pressed.
For the examples below, the configured LED Bumper will be named ledbumper_1
. They will be used in all subsequent examples throughout this API documentation when referring to LEDBumper
class methods.
Below is a list of all methods:
Mutators – Change colors and brightness.
set_color – Set the color of the LED Bumper.
set_brightness – Set the brightness of the LED Bumper.
Getters – Return data from the LED Bumper.
is_pressed – Returns whether or not the LED Bumper is being pressed.
Mutators#
set_color#
set_color
sets the color of the LED Bumper. If the LED is not already on when this method is used, it will set the brightness to 100% to turn the LED on.
Usage:
ledbumper_1.set_color(color)
Parameters |
Description |
---|---|
|
The color to set the LED Bumper to:
|
# Example coming soon
set_brightness#
set_brightness
sets the brightness of the LED Bumper.
Usage:
ledbumper_1.set_brightness(color)
Parameters |
Description |
---|---|
|
The brightness of the LED as a percent from 0% to 100%. |
# Example coming soon
Getter#
is_pressed#
pressed
returns a Boolean indicating whether or not the LED Bumper is pressed.
True
– The bumper was pressed.False
– The bumper was not pressed.
Usage:
ledbumper_1.is_pressed()
Parameters |
Description |
---|---|
This method has no parameters. |
# Example coming soon