pub struct Delay<SPEED> { /* private fields */ }
Expand description

A busy-loop delay implementation

Example

// Instead of arduino_hal below you may also use a different
// HAL based on avr_hal_generic like attiny_hal or atmega_hal
// depending on actual hardware. For example:
//
// use attiny_hal as hal;

use arduino_hal as hal;
use hal::prelude::*;

let mut delay = hal::delay::Delay::<hal::clock::MHz16>::new();

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

Warning

The delay is not accurate for values above 4095µs because of a loop whose overhead is not accounted for. This will be fixed in a future version.

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Pauses execution for ms milliseconds

Pauses execution for ms milliseconds

Pauses execution for us microseconds

Pauses execution for us microseconds

Pauses execution for us microseconds

Pauses execution for us microseconds

Pauses execution for us microseconds

Pauses execution for us microseconds

Pauses execution for us microseconds

Pauses execution for us microseconds

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.