Herunterladen Diese Seite drucken

LEGO MINDSTORMS Education EV3 MicroPython Erste Schritte Seite 18

Werbung

KAPITEL
DREI
EV3 STEIN – DER PROGRAMMIERBARE EV3 STEIN
LEGO
 MINDSTORMS
Education EV3 Stein
®
®
3.1 Tasten
buttons ()
Hiermit wird überprüft, welche Tasten auf dem EV3 Stein derzeit gedrückt werden.
Returns Liste der gedrückten Tasten.
Return type Liste der
Beispiele:
# Do something if the left button is pressed
if
Button.LEFT
print("The left button is
# Wait until any of the buttons are pressed
while not
any(brick.buttons()):
wait(10)
# Wait until all buttons are released
while
any(brick.buttons()):
wait(10)
3.2 Licht
light(color)
Hiermit wird die Farbe der EV3 Stein-Leuchte eingestellt.
Parameters color(Color) – Farbe des Lichts: Wähle Color.BLACK oder None aus, um das
Licht auszuschalten.
Beispiel:
# Make the light red
brick.light(Color.RED)
# Turn the light off
brick.light(None)
Buttons
in
brick.buttons():
pressed.")
LEGO, the LEGO logo and MINDSTORMS are trademarks of the LEGO Group.
©2019 The LEGO Group.
16

Werbung

loading