Skip to content

Delay on attiny-hal fails with no method in scope #310

Answered by Rahix
flpydsk asked this question in Q&A
Discussion options

You must be logged in to vote

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 …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Rahix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #250 on September 02, 2022 10:31.