Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

RP2040-Zero RGB LED Project

This project drives the onboard WS2812 RGB LED on the Waveshare RP2040-Zero using the Raspberry Pi Pico SDK. The LED cycles through colors (Rainbow effect) with a period of approximately 1 minute.

Features

  • Smooth Color Cycling: Uses floating-point HSV to RGB conversion for seamless color transitions.
  • High Refresh Rate: Updates the LED at 100Hz (every 10ms) for fluid animation.
  • Precise Timing: Uses RP2040's PIO (Programmable I/O) block to drive WS2812 timing, ensuring stability independent of CPU load.
  • Bright Colors: Saturation and Value are set to maximum for vivid output.

Prerequisites

To build this project, you need the following installed on your system:

  1. Raspberry Pi Pico SDK: The build system will attempt to download it automatically if not found.
  2. CMake: Build system generator.
  3. ARM GCC Toolchain: Compiler for the RP2040 (arm-none-eabi-gcc).
    • On macOS with Homebrew: brew install --cask gcc-arm-embedded

Building

  1. Create a build directory:
    mkdir build
    cd build
  2. Configure the project (this will download the SDK if needed):
    cmake .. -DPICO_SDK_FETCH_FROM_GIT=ON
  3. Compile:
    make

Flashing

  1. Hold the BOOT button on the RP2040-Zero while plugging it into USB (or press RESET while holding BOOT).
  2. The board will appear as a mass storage device named RPI-RP2.
  3. Drag and drop the generated rp2040_zero_led.uf2 file from the build directory onto the RPI-RP2 drive.

Project Structure

  • main.c: Main application logic containing the HSV color conversion and animation loop.
  • ws2812.pio: PIO assembly program handling the strict timing requirements of the WS2812 LED protocol.
  • CMakeLists.txt: Build configuration for the Pico SDK.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages