Important Announcement
PubHTML5 Scheduled Server Maintenance on (GMT) Sunday, June 26th, 2:00 am - 8:00 am.
PubHTML5 site will be inoperative during the times indicated!

Home Explore Turtle Programming Guide

Turtle Programming Guide

Published by chongwanleng_1991, 2015-06-27 03:15:00

Description: Turtle Programming Guide

Search

Read the Text Version

© ALL RIGHTS RESERVED

Exercise 1: Movements• Create a program in the Scratch software to allow the Turtle to start moving forward and backward. – In this program, the Turtle will be moving forward at its fastest speed for 10 seconds, followed by moving backward for 10 seconds. Any unauthorized reprint or use of this material is prohibited.

Exercise 2: Tilt Sensor• Attach a tilt sensor to the Turtle. Create a program that will define different moving direction at a different tilted angle. – Set the motor direction to “that way” to allow the Turtle to move forward when the tilt sensor is tilted down (1). – Set the motor direction to “this way” to allow the Turtle to move backward when the tilt sensor is tilted up (3). Any unauthorized reprint or use of this material is prohibited.

Exercise 3: Distance Sensor• Replace the tilt sensor with a distance sensor and create a program to make use of the distance sensor.• In this program, the Turtle will keep moving forward until an obstacle is detected. If the obstacle is found to be within a distance of 60, the Turtle will move backward for 20 seconds. Any unauthorized reprint or use of this material is prohibited.


Like this book? You can publish your book online for free in a few minutes!
Create your own flipbook