2016-08-17 02:04:21 +02:00
|
|
|
# WaitMicros
|
|
|
|
|
|
|
|
Blocks the current fiber for the given amount of micro-seconds.
|
|
|
|
|
|
|
|
```sig
|
|
|
|
control.waitMicros(4)
|
|
|
|
```
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## Example
|
2016-08-17 02:04:21 +02:00
|
|
|
|
|
|
|
This program sends a 10 micro-second HIGH pulse through pin ``P0``.
|
|
|
|
|
|
|
|
```blocks
|
|
|
|
// 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)
|
|
|
|
```
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
### ~hint
|
2016-08-17 02:04:21 +02:00
|
|
|
|
|
|
|
This function is not supported in the simulator.
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
### ~
|
2016-08-17 02:04:21 +02:00
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
## See Also
|
2016-08-17 02:04:21 +02:00
|
|
|
|
|
|
|
[pause](/reference/basic/pause)
|