DIPIMPIN#
Perkenalan#
Robot Coding VEX AIM memiliki enam LED (Light-Emitting Diodes) di sekeliling badan robot. LED tersebut dapat diatur ke berbagai warna untuk memberikan umpan balik, menunjukkan status robot, atau mempermudah pelacakan robot selama proyek berlangsung.
Setiap LED dapat diatur secara individual, semua LED dapat diatur secara bersamaan, atau sekelompok LED dapat diatur bersama-sama menggunakan tuple.
Nama LED:
|
|
|
|---|---|---|
|
|
|
|
Berikut adalah daftar semua metode:
Aksi — Menghidupkan atau mematikan LED.
Tindakan#
on#
on akan menyalakan satu LED, semua LED, atau sekelompok LED.
Usage:
robot.led.on(led, color)
Parameter |
Keterangan |
|---|---|
|
LED atau LED yang akan dinyalakan:
|
|
Opsional. Warna yang akan diatur untuk LED yang dipilih:
|
Contoh
# 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 mematikan satu LED, semua LED, atau sekelompok LED.
Usage:
robot.led.off(led)
Parameter |
Keterangan |
|---|---|
|
LED atau LED yang akan dimatikan:
|
Contoh
# 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))






