These two are likely the first in a range of generic LEGO trains with a
City Hub and a DC Train Motor. Instead of adding examples to each,
we add generic train examples in a shared folder and link to them.
We reserve these folders specifically for these sets and their B models.
Add a header with links to the LEGO Education website for building
instructions and SD card image download. This way if someone gets a
copy of the program, they don't have to go searching for documentation.
30% is near the static friction limit of the medium motor itself. In the latest tests, the motor was stalling without moving, so bump up the minimum duty cycle to fix it with a reasonable safety margin.
Remove extra gyro_offset factor that causes gyro_bot to not leave the stand.
My gyro sensor has an offset of -17 which causes gyro_offset to become very large with this calculation.
Since the code is using the `*=` operator, the current calculation is `(1 - GYRO_OFFSET_FACTOR) * gyro_offset * gyro_offset`, but I believe the desired calculation is `(1 - GYRO_OFFSET_FACTOR) * gyro_offset` to make this moving average correct.
This example computed time from length, to then drive for that time. Since there is now simply a function to drive straight for a given distance, use that instead.
Also add wait after drive(0, 0) to give it some time to reach that speed (a standstill).
Also fix ImageFile import
Breaking changes were made in the motor API.
The stop(Stop.*) methods was split into explicit methods and the stop
argument in run_* methods was renamed and the default value changed in
some cases.
Functionality is still not quite the same as EV3-G/Scratch.
action_update() should remember the old speed during ultrasonic
reaction and then restore it.
Also, tuning is a bit off since loop time is ~26ms compared to ~18
in EV3-G/Scratch.