Module atmega32u4_hal::delay[][src]

Delay using a busy loop

The implementation is a port from the ArduinoCore-avr library. Timing should be cycle accurate up to 4096us. Above that, an overhead from outer loops that is not yet calculated in, will lead to slightly longer delays. If you need exact timing, please use a timer.

Example

use atmega32u4_hal::delay;
let mut delay = delay::Delay::<delay::MHz16>::new();

// Wait 1s
delay.delay_ms(1000);

Structs

Delay

Delay abstraction

MHz1

1 MHz Clock

MHz8

8 MHz Clock

MHz12

12 MHz Clock

MHz16

16 MHz Clock

MHz20

20 MHz Clock

MHz24

24 MHz Clock