49 lines
1.4 KiB
Markdown
49 lines
1.4 KiB
Markdown
# Micro-Rust
|
|
|
|
A sample project for [rust](https://www.rust-lang.org/) and
|
|
[embassy](https://embassy.dev/) on a [micro:bit](https://microbit.org/).
|
|
|
|
It uses the buttons to cycle through predefined led patterns.
|
|
|
|
![micro:bit with heart pattern](screenshot.jpg)
|
|
|
|
# Building
|
|
|
|
The recommended way is to use [nix](https://nixos.org/download/) with
|
|
[nix flakes](https://nixos.wiki/wiki/Flakes). It still is not for the faint of
|
|
heart but worth the investment.
|
|
|
|
Otherwise, [rustup](https://rustup.rs/) and other tools can be installed
|
|
manually.
|
|
|
|
## Nix
|
|
|
|
Install [nix](https://nixos.org/download/) and enable
|
|
[nix flakes](https://nixos.wiki/wiki/Flakes).
|
|
|
|
Enter the dev environment with `nix develop`. From there on the usual rust
|
|
commands work.
|
|
|
|
## Manual Way
|
|
|
|
Install [rustup](https://rustup.rs/), [probe-rs](https://probe.rs/) and
|
|
[flip-link](https://github.com/knurling-rs/flip-link). When running rust
|
|
commands (such as `cargo build`), rustup should pull in the specified toolchain.
|
|
|
|
# Usage
|
|
|
|
Connect the micro:bit to the computer and verify that it is listed when running
|
|
`probe-rs list`.
|
|
|
|
Using the normal `cargo run` command, will build the project, flash it onto the
|
|
microcontroller and run it.
|
|
|
|
Use the buttons to cycle through the different patterns.
|
|
|
|
# License
|
|
|
|
Licensed as [GPLv3](https://www.gnu.org/licenses/gpl-3.0.html) (apart from
|
|
[nrf52833.svd](nrf52833.svd) which is
|
|
[BSD-3-Clause](https://opensource.org/license/bsd-3-clause) and only used for
|
|
debugging).
|