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.2 - Setup Code
Setup Code
All Edison programs must contain the Setup code that you see every time you open the EdPy App.
#-------------Setup----------------
import Ed
Ed.EdisonVersion = Ed.V2
Ed.DistanceUnits = Ed.CM
Ed.Tempo = Ed.TEMPO_MEDIUM
#--------Your code below-----------
As you already learned lines starting with # are comments.
import Ed
The above code imports a library with commands that control edison robot.
Ed.DistanceUnits = Ed.CM
The above code sets the units to cm in driving commands
Ed.Tempo = Ed.TEMPO_MEDIUM
The above code sets the speed of playing music to normal speed.