Esempio n. 1
0
power_f = 100
power_t = 100

mission.startMission()
while True:
        
	
	print("Forward") 
	move.forward(power_f)
	sleep(4)
	move.stop()

	print("turn left")
	move.leftMotor(power_f, 0)
	move.rightMotor(power_f, 1)
	sleep(1)
	move.stop()
	sleep(1)

	print("turn right")
	move.leftMotor(power_f, 1)
	move.rightMotor(power_f, 0)
	sleep(1)
	move.stop()
	sleep(1)
	
	print("Back")
	move.backward(power_f)
	sleep(4)
	move.stop()
Esempio n. 2
0
File: t2.py Progetto: mattvenn/v2
print("robot will now move forward by 60 cm  on button press")
sleep(1)
mission.startMission()
sleep(1)
move.position(60,100)
sleep(5)
move.stop()

print("leftMotor(speed,direction) and rightMotor (speed,direction) on button press")
sleep(1)
mission.startMission()
sleep(1)
move.leftMotor(50,1)
sleep(1)
print("moving right motor now")
move.rightMotor(50,0)
sleep(1)
print("now both motors together  now")
move.rightMotor(50,1)
move.leftMotor(50, 1)
sleep(1)

move.stop()

print("Will now turn around like crazy on button press")
print("Robot will now rotate by minus 90 degrees")
mission.startMission()
move.rotate(-90,100)
sleep(4)
move.stop()
print("Will not disable the motors")