1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-07 18:16:15 +02:00

Add other files for compass exercise to exercise page.

This commit is contained in:
Andrew Walbran 2023-03-17 17:17:28 +00:00
parent 8513adfd3c
commit e2d7bc56ec

View File

@ -12,17 +12,35 @@ shouldn't be necessary for this exercise.
If you have time, try displaying it on the LEDs somehow too, or use the buttons somehow. If you have time, try displaying it on the LEDs somehow too, or use the buttons somehow.
`src/main.rs`:
```rust,compile_fail ```rust,compile_fail
{{#include compass/src/main.rs:top}} {{#include compass/src/main.rs:top}}
use microbit::{hal::uarte::{Baudrate, Parity, Uarte}, Board}; use microbit::{hal::uarte::{Baudrate, Parity, Uarte}, Board};
{{#include compass/src/main.rs:main}} {{#include compass/src/main.rs:main}}
// TODO
{{#include compass/src/main.rs:loop}} {{#include compass/src/main.rs:loop}}
// TODO
} }
} }
``` ```
`Cargo.toml` (you shouldn't need to change this):
```toml
{{#include compass/Cargo.toml}}
```
`Embed.toml` (you shouldn't need to change this):
```toml
{{#include compass/Embed.toml}}
```
`.cargo/config.toml` (you shouldn't need to change this):
```toml
{{#include compass/.cargo/config.toml}}
```
See the serial output with See the serial output with
```sh ```sh