Book
Module 8 - Section 1 - Ed Py
Module 8 - Section 1 - Ed Py
Completion requirements
View
After the completion of this module the students will be able to:
- describe the Edpy environment
- use the setup functions of Edpy
- create code to drive forward and backward the Edison robot using Edpy commands
- create code to turn the Edison robot using Edpy commands
8.1.5 - Unlimited Distance - limited Time
So what if you want to drive your robot without stopping or stop it after an event or after some time. Then you have to use the parameter Ed.DISTANCE_UNLIMITED
Copy the following code to edison
#-------------Setup----------------
import Ed
Ed.EdisonVersion = Ed.V2
Ed.DistanceUnits = Ed.CM
Ed.Tempo = Ed.TEMPO_MEDIUM
#--------Your code below-----------
Ed.Drive(Ed.FORWARD, Ed.SPEED_6, Ed.DISTANCE_UNLIMITED)
Ed.TimeWait(500, Ed.TIME_MILLISECONDS)
Ed.Drive(Ed.STOP, Ed.SPEED_10, 0)
With these set of commands edison drives forward with speed 6 for 500 milliseconds or half a second.