Skip to content

SimonWaldherr/rp2040-examples

Repository files navigation

RP2040 Examples

DOI

Welcome to the RP2040 Examples repository! This collection showcases various projects and code samples for the Raspberry Pi Pico and other RP2040-based microcontroller boards. Whether you're a beginner looking to get started with MicroPython or an experienced developer exploring Golang on embedded systems, you'll find something useful here.

If you're also interested in Raspberry Pi projects using Golang, be sure to check out my Raspberry Pi Golang examples.


Table of Contents


Where to Buy

The Raspberry Pi Pico is a powerful yet affordable microcontroller that you can purchase from various retailers worldwide. Here are some trusted sources:


Documentation & Resources

To get the most out of your Raspberry Pi Pico, you can refer to the following documentation and resources:


MicroPython

MicroPython is an efficient and beginner-friendly way to program your Raspberry Pi Pico. Follow the links below to download the latest firmware:

MicroPython Examples

Explore these example scripts to get hands-on with MicroPython:


Golang

For those who prefer to code in Golang, this section provides examples of using Golang on the Raspberry Pi Pico with the TinyGo compiler.

Golang Examples

  • blink.go
    Blink an LED using Golang. Install TinyGo and compile with:

    tinygo build -o blink.uf2 -target=pico blink.go

    Flash directly to the Pico with:

    tinygo flash -target=pico blink.go

    Add -monitor to the command to see the program’s output in the terminal.

  • blink_with_ws2812.go
    Control WS2812 LEDs using Golang, creating vibrant lighting effects.

  • blink_with_ws2812_struct.go
    An advanced example for controlling WS2812 LEDs using structured Golang code.

  • read_rfid_with_rc522.go
    Read RFID cards and tags using the RC522 module and Golang.


Contributing

Contributions are welcome! If you have a project or code sample you'd like to share, feel free to submit a pull request.


License

This repository is licensed under the MIT License. For more details, see the LICENSE file.


Feel free to explore the examples and contribute to this growing repository! Whether you're building a simple LED blinker or a complex sensor network, these examples are designed to help you get the most out of your Raspberry Pi Pico.