Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Ed
- Ed.EdisonVersion = Ed.V2
- Ed.DistanceUnits = Ed.CM
- Ed.Tempo = Ed.TEMPO_MEDIUM
- #--------Your code below-----------
- while 1:
- L = Ed.ReadLeftLightLevel()
- R = Ed.ReadRightLightLevel()
- while abs(L - R) > 100:
- if L > R:
- Ed.Drive(Ed.SPIN_LEFT, 3, 10)
- else:
- Ed.Drive(Ed.SPIN_RIGHT, 3, 10)
- Ed.TimeWait(50, Ed.TIME_MILLISECONDS)
- L = Ed.ReadLeftLightLevel()
- R = Ed.ReadRightLightLevel()
Advertisement
Add Comment
Please, Sign In to add comment