from Myro import *
makeRobot("ROSARDrone")
ROSARDrone
Time to take off!
speak("Please prepare for liftoff")
for i in range(10, 0, -1):
speak(str(i))
reset()
takeoff()
Please prepare for liftoff 10 9 8 7 6 5 4 3 2 1
turnLeft(1, .5)
gamepad()
Pad Action ------ ------- Left/Right turnLeft() and turnRight() Up/Down forward() and backward() Button Action ------ ------- 1 stop() 2 takePicture() 3 beep(.25, 523) 4 beep(.25, 587) 5 beep(.25, 659) 6 speak('Hello. My name is .') 7 speak('Ouch! I'm a sensitive robot.') 8 speak('I'm hungry. Do you have any batteries?') Gamepad is now running... Press button 1 to stop.
turnLeft(1, .6)
land()
And snap a picture:
p = takePicture()
calico.display(p)
Take 15 seconds worth of pictures and display them.
for i in timer(15):
calico.animate(takePicture())
Using a list of pictures (for ten seconds) to create an animated gif.
lst = []
for t in timer(5):
p = takePicture()
show(p)
lst.append(p)
filename = "drone-%f.gif" % currentTime()
savePicture(lst, filename)
calico.display(calico.HTML("<img src = %s>" % filename))
Now display the animated gif