Skip to content

Commit 9707b7e

Browse files
committed
Update 05-led-roulette/the-challenge.md to the new crate versions.
1 parent 481ab5d commit 9707b7e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

microbit/src/05-led-roulette/the-challenge.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,25 @@ you can use the display API provided by the BSP. It works like this:
2525
use cortex_m_rt::entry;
2626
use rtt_target::rtt_init_print;
2727
use panic_rtt_target as _;
28+
use embedded-hal::delay::DelayNS;
2829
use microbit::{
2930
board::Board,
3031
display::blocking::Display,
31-
hal::{prelude::*, Timer},
32+
hal::Timer,
3233
};
3334

3435
#[entry]
3536
fn main() -> ! {
3637
rtt_init_print!();
3738

3839
let board = Board::take().unwrap();
40+
3941
let mut timer = Timer::new(board.TIMER0);
4042
let mut display = Display::new(board.display_pins);
43+
44+
// Setup the display delay so the math works as expected later.
45+
display.set_delay_ms(1);
46+
4147
let light_it_all = [
4248
[1, 1, 1, 1, 1],
4349
[1, 1, 1, 1, 1],
@@ -48,9 +54,11 @@ fn main() -> ! {
4854

4955
loop {
5056
// Show light_it_all for 1000ms
51-
display.show(&mut timer, light_it_all, 1000);
57+
display.show(&mut timer, light_it_all, 1_000);
58+
5259
// clear the display again
5360
display.clear();
61+
5462
timer.delay_ms(1000_u32);
5563
}
5664
}

0 commit comments

Comments
 (0)