pxt-ev3/docs/reference/motors/motor/reset.md
Galen Nickel 88c58b4e76 First set of 'motors' topics (#305)
* Start of 'motors' topics

* Draft the 'motor motion' side doc

* Add / update more topics

* Last blast of edits

* Capture some more edits

* Put in movement and steering details
2018-02-06 19:43:50 -08:00

711 B

reset

Reset the motor's speed setting and it's counters.

motors.largeA.reset()

The motor's speed is set back to 0 and the tacho, angle, and speed counters are set to 0.

Example

See what the angle count is when a motor is stopped. Then, try it again after a reset.

motors.largeA.setSpeed(30)
loops.pause(2000)
motors.largeA.stop()
brick.showString("Angle count:", 1)
brick.showNumber(motors.largeA.angle(), 2)
motors.largeA.setSpeed(30)
loops.pause(2000)
motors.largeA.reset()
brick.showString("Angle count:", 4)
brick.showNumber(motors.largeA.angle(), 5)

See also

stop, clear counts