Skip to content

Commit e5a0104

Browse files
committed
Moved the 05-led-roulette light-it-up example to a project example
1 parent b90938a commit e5a0104

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#![deny(unsafe_code)]
2+
#![no_main]
3+
#![no_std]
4+
5+
use cortex_m_rt::entry;
6+
use embedded_hal::digital::OutputPin;
7+
use panic_halt as _;
8+
use microbit::board::Board;
9+
10+
#[entry]
11+
fn main() -> ! {
12+
let mut board = Board::take().unwrap();
13+
14+
board.display_pins.col1.set_low().unwrap();
15+
board.display_pins.row1.set_high().unwrap();
16+
17+
loop {}
18+
}

microbit/src/05-led-roulette/light-it-up.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,7 @@ The code required to light up an LED in the matrix is actually quite simple but
3232
a look at it and then we can go through it step by step:
3333

3434
```rust
35-
#![deny(unsafe_code)]
36-
#![no_main]
37-
#![no_std]
38-
39-
use cortex_m_rt::entry;
40-
use embedded_hal::digital::OutputPin;
41-
use panic_halt as _;
42-
use microbit::board::Board,
43-
44-
#[entry]
45-
fn main() -> ! {
46-
let mut board = Board::take().unwrap();
47-
48-
board.display_pins.col1.set_low().unwrap();
49-
board.display_pins.row1.set_high().unwrap();
50-
51-
loop {}
52-
}
35+
{{#include examples/light-it-up.rs}}
5336
```
5437

5538
The first few lines until the main function just do some basic imports and setup we already looked at before.

0 commit comments

Comments
 (0)