Download presentation
Presentation is loading. Please wait.
Published byToby Matthew Skinner Modified over 9 years ago
1
Taking Pictures Sec 9-9 Web Design
2
Objectives The student will: Know how command the scribbler robot to take a picture. Know how to display the picture taken by the robot Know how to save a picture or pictures.
3
Taking a Picture The command to take a picture in Myro is: takePicture("color") – Simply issuing the command does nothing but instruct the robot to take a picture. – The picture is not saved – The picture is not displayed To take and display a picture at the same time you can: show(takePicture())
4
Storing a Picture in a Variable A picture can be stored in a variable. pic = takePicture("color") Once stored the picture can be displayed over and over again: show(pic) – This command will display the same picture every time.
5
Saving a Picture in a File Myro has a command to save pictures in a file. savePicture(pic,"my_picture.jpg")
6
Taking a Series of Pictures Your robot can be programmed to scan its environment and display what it sees: while timeRemaining(40): show(takePicture("color")) turnLeft(0.5,.1)
7
Animated Gifs You can also save an animated GIF of the images generated by the robot by using the savePicture command by accumulating a series of images in a list. Pics = [] while timeRemaining(40): pic=takePicture("color") show(pic) Pics.append(pic) turnLeft(0.5,.1) savePicture(Pics, "room_movie.gif")
8
Summary The command to take a picture in Myro is: takePicture("color") Pictures can be stored or saved. The robot can programmed to “scan” its environment.
9
Rest of Today Program your robot to scan the room and take pictures. – Work with the settings on the turn command so that the pictures only overlap slightly or don’t overlap but are close. – Same this in a python file. This is the beginning of your final project!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.