LED Bumper#
Introducción#
El parachoques LED puede detectar cuándo se presiona y puede cambiar su color o patrón para proporcionar información visual.
A continuación se muestra una lista de todos los bloques:
Set Bumper color — Tells the LED Bumper what color to be.
Set Bumper brightness — Tells the LED Bumper what brightness to be at.
Bumper pressed — Reports a Boolean indicating if the LED Bumper is being pressed.
Set Bumper color#
The Set Bumper color stack block tells the LED Bumper what color to be, or to turn off.
The LED Bumper can be used to track where the robot is at in a project or to show when certain conditions are met.
establecer de [bumper v] a [rojo v]
Parámetros |
Descripción |
|---|---|
CONDUJO |
El parachoques LED seleccionado para cambiar el color, configurado en la ventana Dispositivos. |
color |
The color to set the LED Bumper to:
|
Ejemplo
cuando empezó :: hat events
[Build Used: Super Code Base 2.0]
[Blink the LED off and on.]
para siempre
establecer de [bumper v] a [verde v]
esperar [0.5] segundos
establecer de [bumper v] a [apagado v]
esperar [0.5] segundos
Set Bumper brightness#
The Set Bumper brightness stack block tells the LED Bumper what brightness to be.
A higher percentage makes the light brighter. A lower percentage makes the light dimmer.
If the LED Bumper is off, setting the light power above 0% will turn the light on.
If the LED Bumper is on, setting the light power at 0% will turn the light off.
Establezca el brillo [bumper v] al [50]%
Parámetros |
Descripción |
|---|---|
CONDUJO |
El parachoques LED seleccionado para cambiar el brillo, configurado en la ventana Dispositivos. |
brillo |
The new brightness to set the LED Bumper to from 0% to 100% as a whole number. |
Ejemplo
cuando empezó :: hat events
[Build Used: Super Code Base 2.0]
[Light up the LED at different brightness levels.]
Establezca el brillo [bumper v] al [25]%
establecer de [bumper v] a [verde v]
esperar [2] segundos
Establezca el brillo [bumper v] al [100]%
Bumper pressed#
The Bumper pressed Boolean block reports whether or not the LED Bumper is being pressed. This can be used to check if the robot bumps into other objects.
True — The LED Bumper is being pressed pressed.
False — The LED Bumper is not being pressed.
<[bumper v] presionado?>
Parámetros |
Descripción |
|---|---|
CONDUJO |
El parachoques LED seleccionado para verificar, configurado en la ventana Dispositivos. |
Ejemplo
cuando empezó :: hat events
[Build Used: Super Code Base 2.0]
[Turn right when the bumper is pressed.]
turno [izquierda v]
esperar hasta <[bumper v] presionado?>
turno [derecha v]