pxt-calliope/docs/reference/control/wait-micros.md
Sam El-Husseini e3975e65e5 pxt-microbit Accessibility PR (#529)
* Accessibility changes
2017-09-07 13:42:08 -07:00

579 B

WaitMicros

Blocks the current fiber for the given amount of micro-seconds.

control.waitMicros(4)

Example

This program sends a 10 micro-second HIGH pulse through pin P0.

// ensure pin is low to send a clean pulse
pins.digitalWritePin(DigitalPin.P0, 0)
control.waitMicros(2)
// set pin to 1 and wait 10 micros
pins.digitalWritePin(DigitalPin.P0, 1)
control.waitMicros(10)
// finish pulse
pins.digitalWritePin(DigitalPin.P0, 0)

~hint

This function is not supported in the simulator.

~

See Also

pause