File tree Expand file tree Collapse file tree 2 files changed +19
-18
lines changed
microbit/src/05-led-roulette Expand file tree Collapse file tree 2 files changed +19
-18
lines changed Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change @@ -32,24 +32,7 @@ The code required to light up an LED in the matrix is actually quite simple but
32
32
a look at it and then we can go through it step by step:
33
33
34
34
``` 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}}
53
36
```
54
37
55
38
The first few lines until the main function just do some basic imports and setup we already looked at before.
You can’t perform that action at this time.
0 commit comments