# Library laden
from ev3robot import *
# Roboter initialisieren
roebi = LegoRobot() # Roboter
motor = Gear() # Motoren
roebi.addPart(motor) # Dem Roboter anfügen
light = LightSensor(SensorPort.S3) # Kontrollieren, dass der Sensor auch an diesem Port hängt
roebi.addPart(light)
us = UltrasonicSensor(SensorPort.S4) # Kontrollieren, dass der Sensor auch an diesem Port hängt
roebi.addPart(us)
while True:
v = light.getValue()
roebi.drawString("L="+str(v), 0, 0)
d = us.getDistance()
roebi.drawString("D="+str(d), 0, 1)