Steer left and right py v2
From wikiluntti
<languages /> <translate>
Introduction
Test if multiple steering blocks can be aligned one after other. Works perfectly.
Robot
The idea and principle works for almost any robot thought this is tested using Asimov.
Sensors
No sensors.
An Illuminating Example
Theory
Cascade a few .on() functions to steer first left then right. Sleep a few seconds in between the rounds.
An Example Code
#!/usr/bin/env python3
from ev3dev2.motor import MoveSteering, OUTPUT_B, OUTPUT_C
from time import sleep
<!--T:12-->
#How about move steering?
steer_pair = MoveSteering(OUTPUT_B, OUTPUT_C)
steer_pair.on(steering=-20, speed=5)
sleep(10)
#steer_pair.off()
<!--T:13-->
steer_pair.on(steering=20, speed=5)
sleep(10)
<!--T:14-->
steer_pair.off()
Exercises
1. Make the robot to steer around a table or a chair. Try to stop it at the starting position
2. Make the robot stop
- After 10 seconds
- After 3.5 rotations of the left tire
- After the colour sensor finds a black tape.
3. Try different steering values:
- 0
- -50 and +50
- -100 and +100
- -110 and +110
</translate>