Crates.io | cytron_maker_pi_rp2040 |
lib.rs | cytron_maker_pi_rp2040 |
version | 0.6.0 |
source | src |
created_at | 2021-12-25 11:00:35.07406 |
updated_at | 2023-10-02 03:43:11.350995 |
description | Board Support Package for the Cytron Maker Pi RP2040 |
homepage | https://github.com/9names/makerpi_rp2040 |
repository | https://github.com/9names/makerpi_rp2040 |
max_upload_size | |
id | 502945 |
size | 47,943 |
You should include this crate if you are writing code that you want to run on
a Cytron Maker Pi RP2040
.
This crate includes the rp2040-hal, but also configures each pin of the RP2040 chip according to how it is connected up on the Maker Pi RP2040.
Maker Pi RP2040 is an embedded robot control board by Cytron.
You can find more info about it on the Maker Pi RP2040 product page
To use this crate, your Cargo.toml
file should contain:
cytron_maker_pi_rp2040 = "0.5"
In your program, you will need to call cytron_maker_pi_rp2040::Pins::new
to create
a new Pins
structure. This will set up all the GPIOs for any on-board
devices. See the examples folder for more details.
To compile an example, clone this repository and run:
makerpi_rp2040 $ cargo build --release --example <name>
You will get an ELF file called
./target/thumbv6m-none-eabi/release/examples/<name>
, where the target
folder is located at the top of the repository checkout. Normally
you would also need to specify --target=thumbv6m-none-eabi
but when
building examples from this git repository, that is set as the default.
If you want to convert the ELF file to a UF2 and automatically copy it to the USB drive exported by the RP2040 bootloader, simply boot your board into bootloader mode and run:
makerpi_rp2040 $ cargo run --release --example <name>
If you get an error about not being able to find elf2uf2-rs
, try:
$ cargo install elf2uf2-rs
then try repeating the cargo run
command above.
Flashes a sequence across the Digital IO Status LEDs
Rotates a stepper motor through 360 degrees clockwise then anticlockwise.
Note that this requires a specific stepper motor from Seeedstudio
Cycle through colors on the pair of onboard RGB LEDs
Plays a sweeping frequency pitch through the on-board buzzer.
Note: the example uses a short pulse length to keep the volume down - see documentation in the code to make it loud!
SPDX-License-Identifier: Apache-2.0 OR MIT