Beispiel #1
0
from time import sleep
from Robot import Robot
from Mover import Mover
from Shooter import Shooter
from Light import Light
from Sonar import Sonar
from nxt.motor import PORT_A, PORT_B, PORT_C
from nxt.sensor import PORT_4, PORT_3, PORT_2, PORT_1

print "Creating Robot"
robot = Robot('ICTCLUB1')
robot.extend(Mover(PORT_C, PORT_B))
robot.extend(Light(PORT_3))
robot.extend(Sonar(PORT_1))
###########################################################################
# Start your program here                                                 #
###########################################################################

# Program start
brightness = robot.howbright()
print "Brightness=",brightness

###########################################################################
# End of program                                                          #
###########################################################################
robot.stopmoving()
robot.lightoff()
print "Robot Stopped"

robot.__del__()