-
using rev e897783
reproduce with: #![no_std]
#![no_main]
use attiny_hal::delay::*;
use attiny_hal::clock::*;
extern crate panic_halt;
#[attiny_hal::entry]
fn main() -> ! {
let pins = attiny_hal::pins!(attiny_hal::Peripherals::take().unwrap());
let mut delay = Delay::<MHz1>::new();
let mut led = pins.pb4.into_output();
loop {
led.toggle();
delay.delay_ms(1000);
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
Rahix
Mar 5, 2022
Replies: 1 comment
-
The full error message already has the hint to fix this :) error[E0599]: no method named `delay_ms` found for struct `attiny_hal::delay::Delay<attiny_hal::clock::MHz1>` in the current scope --> examples/trinket/src/bin/trinket-blink.rs:16:15 | 16 | delay.delay_ms(1000); | ^^^^^^^^ method not found in `attiny_hal::delay::Delay<attiny_hal::clock::MHz1>` | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a `use` for it: | 4 | use embedded_hal::blocking::delay::DelayMs; | Just add use embedded_hal::blocking::delay::DelayMs; to your imports. You'll also need to explicitly specify the type of the delay integer: delay.delay_ms(1000u16); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Rahix
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The full error message already has the hint to fix this :)
Just add
to your imports. You'll also need to …