LED#
Johdanto#
VEX AIM -koodausrobotissa on kuusi LEDiä (valoa emittoivaa diodia) robotin rungon ympärillä. LEDit voidaan asettaa eri väreille antamaan palautetta, näyttämään robotin tilan tai helpottamaan robotin seurantaa projektin aikana.
Jokainen LED voidaan asettaa erikseen, kaikki LEDit voidaan asettaa samanaikaisesti tai LED-ryhmä voidaan asettaa yhdessä tuplen avulla.
LEDien nimet:
|
|
|
|---|---|---|
|
|
|
|
Alla on luettelo kaikista menetelmistä:
Toiminnot — Kytke LEDit päälle tai pois päältä.
Toiminnot#
on#
on ryhmän.
Usage:
robot.led.on(led, color)
Parametri |
Kuvaus |
|---|---|
|
Syttyvät LEDit:
|
|
Optional. The color to set the selected LED or LEDs to:
|
Esimerkkejä
# Turn all LEDs green while the screen is pressed
while True:
if robot.screen.pressing():
robot.led.on(ALL_LEDS, GREEN)
else:
robot.led.off(ALL_LEDS)
wait(50, MSEC)
# Turn two LEDs red
robot.led.on((LED3, LED4), RED)
off#
off sammuttaa yhden LEDin, kaikki LEDit tai LED-ryhmän.
Usage:
robot.led.off(led)
Parametri |
Kuvaus |
|---|---|
|
Sammutettavat LEDit:
|
Esimerkkejä
# Turn all LEDs on for 2 seconds, then turn them off
robot.led.on(ALL_LEDS)
wait(2, SECONDS)
robot.led.off(ALL_LEDS)
# Turn off half of the LEDs
robot.led.on(ALL_LEDS)
wait(1, SECONDS)
robot.led.off((LED3, LED4, LED5))






