Build Your Own AI Assistant Part 1 - Creating the Assistant
116820 Views
Is the new Raspberry Pi AI Kit better than Google Coral?
114678 Views
Control Arduino with Python using Firmata / PyFirmata
87081 Views
How to Map with LiDAR - using a Raspberry Pi Zero 2W, RPLidar and Rviz
57314 Views
Creating a Supercomputer with a Raspberry Pi 5 Cluster and Docker Swarm!
53588 Views
Node-Red Automation, MQTT, NodeMCU & MicroPython
52067 Views
Thinkman
Podman vs Docker
MicroPython Robotics
Bottango and Isaaca
LidarBot
Snaszy NAS a 3D printed NAS for Raspberry Pi
Running K3s on Raspberry Pi
0h 36m
From Docker to Podman
0h 28m
MicroPython Robotics Projects with the Raspberry Pi Pico
0h 24m
Bottango Basics
0h 22m
Mini-Rack 3D Design Tutorial
0h 20m
Using the Raspberry Pi Pico's Built-in Temperature Sensor
Learn Linux from the basics to advanced topics.
Learn how to use a Raspberry Pi Pico
Learn MicroPython the best language for MicroControllers
Learn Docker, the leading containerization platform. Docker is used to build, ship, and run applications in a consistent and reliable manner, making it a popular choice for DevOps and cloud-native development.
Learn how to build SMARS robots, starting with the 3D Printing the model, Designing SMARS and Programming SMARS
Learn how to build robots, starting with the basics, then move on to learning Python and MicroPython for microcontrollers, finally learn how to make things with Fusion 360.
Learn Python, the most popular programming language in the world. Python is used in many different areas, including Web Development, Data Science, Machine Learning, Robotics and more.
Learn how to create robots in 3D, using Fusion 360 and FreeCAD. The models can be printed out using a 3d printer and then assembled into a physical robot.
Learn how to create Databases in Python, with SQLite3 and Redis.
KevsRobots Learning Platform
77% Percent Complete
By Kevin McAleer, 3 Minutes
The Raspberry Pi Pico is a popular microcontroller for various projects. This lesson will guide you through setting up Rust for development on the Pico, how to install your Rust programs on the device, techniques for debugging, and walking through a sample program.
To develop Rust programs for the Raspberry Pi Pico, you’ll need to set up your build environment:
cross
cargo install cross
rustup target add thumbv6m-none-eabi
After developing your Rust application, you’ll need to compile it for the Pico and upload it:
cargo build --release --target thumbv6m-none-eabi
Convert the compiled program to UF2 format, which is necessary for the Raspberry Pi Pico bootloader.
Push the RESET button on your Pico while holding the BOOTSEL button, release the BOOTSEL after the device is connected. It should mount as a Mass Storage Device.
Copy your .uf2 file to the Raspberry Pi Pico mass storage device.
.uf2
Debugging microcontroller applications can be challenging. Here are some techniques for debugging Rust programs on the Pico:
println!
Here’s a simple Rust program that blinks an LED on the Raspberry Pi Pico:
#![no_std] #![no_main] use panic_halt as _; use rp_pico::hal::{prelude::*, Timer}; use cortex_m_rt::entry; #[entry] fn main() -> ! { let mut pac = rp_pico::pac::Peripherals::take().unwrap(); let mut watchdog = Watchdog::new(pac.WATCHDOG); let clocks = rp_pico::hal::clocks::init_clocks_and_plls( rp2040::XOSC_CRYSTAL_FREQ, pac.XOSC, pac.CLOCKS, pac.PLL_SYS, pac.PLL_USB, &mut pac.RESETS, &mut watchdog, ) .ok() .unwrap(); let mut delay = Timer::new(pac.TIMER, &mut pac.RESETS); let sio = Sio::new(pac.SIO); let pins = rp_pico::Pins::new( pac.IO_BANK0, pac.PADS_BANK0, sio.gpio_bank0, &mut pac.RESETS, ); let mut led_pin = pins.led.into_push_pull_output(); loop { led_pin.set_high().unwrap(); delay.delay_ms(500); led_pin.set_low().unwrap(); delay.delay_ms(500); } }
This program initializes the board’s peripherals, sets up an LED pin, and then blinks the LED on and off every 500 milliseconds.
In this lesson, you’ve learned how to set up a Rust development environment for the Raspberry Pi Pico, how to install Rust programs on the device, strategies for debugging, and you’ve walked through an example program that blinks an LED.
< Previous Next >
You can use the arrows ← → on your keyboard to navigate between lessons.
← →