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.
Parameters
name
: a string that specifies the pin to configure (P0
throughP4
, orP10
)micros
: a number that specifies the analog period in microseconds.
Example
The following code sets the servo pulse to 1000
microseconds.
See also
micro:bit pins, on pin pressed, analog read pin, digital read pin, digital write pin