pxt-calliope/docs/reference/pins/servo-set-pulse.md
Galen Nickel be617f6100
Insert kitronik servo guide link ()
* Insert kitronik servo guide link

* Del leading space
2019-03-15 13:47:47 -07:00

876 B

Servo Set Pulse

Configure the specified pin as analog output, set the period to 20 ms, and set the pulse width to the specified value.

pins.servoSetPulse(AnalogPin.P1, 1500)

Parameters

  • name: a string that specifies the pin to configure (P0 through P4, or P10)
  • micros: a number that specifies the analog period in microseconds.

Example

The following code sets the servo pulse to 1000 microseconds.

pins.servoSetPulse(AnalogPin.P0, 1000)

See also

@boardname@ pins, on pin pressed, analog read pin, digital read pin, digital write pin

Brief Guide to Servos