pxt-ev3/docs/reference/motors/motor/schedule.md
Peli de Halleux 56bbcde299
Support for smooth acceleration/deceleration in run (#900)
* removed logging

* removing more logging

* always use step for single/multiple motors

* refactored schedule

* account for accel ramp up and down

* added default acc/decel

* rounding speed/angle

* remove hack

* use acceleration time in run too

* handle missing case

* adding notes on motors

* adding sample

* fixed ramp simulation

* clear defaults

* some docs, more later

* adding basic examples

* remove debug msg

* clean json

* added move schedule

* docs

* basic docs
2019-09-02 20:57:23 -07:00

1.0 KiB

Schedule

Schedules an acceleration, constant and deceleration phase at a given speed.

motors.largeA.schedule(50, 100, 500, 100)

The speed setting is a percentage of the motor's full speed. Full speed is the speed that the motor runs when the brick supplies maximum output voltage to the port.

Parameters

  • speed: a number that is the percentage of full speed. A negative value runs the motor in the reverse direction.
  • acceleration: the number of movement units to rotate for while accelerating.
  • value: the number of movement units to rotate for.
  • deceleration: the number of movement units to rotate for while decelerating.
  • unit: the movement unit of rotation. This can be milliseconds, seconds, degrees, or rotations. If the number for value is 0, this parameter isn't used.

See also

tank, steer, stop