Skip to content

9names/makerpi_rp2040

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Board Support for the Cytron Maker Pi RP2040

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.

Cytron 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

Using

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.

Running examples

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.

Examples

Flashes a sequence across the Digital IO Status LEDs
cycle_leds_short

Rotates a stepper motor through 360 degrees clockwise then anticlockwise.
Note that this requires a specific stepper motor from Seeedstudio
stepper_motor

Cycle through colors on the pair of onboard RGB LEDs
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!

Links

SPDX-License-Identifier: Apache-2.0 OR MIT