`smart-leds`
FreeSupport for addressable LEDs including WS2812 and APA102
FreeFree tier
About `smart-leds`
smart-leds-rs is a collection of Rust crates for controlling addressable LED strips and matrices, such as WS2812 and APA102. It provides multiple driver implementations including SPI-based (ws2812-spi-rs, apa102-spi-rs) and timer-based delay (ws2812-timer-delay-rs), along with a trait system (smart-leds-trait) for composing effects, modifiers, and drivers. The main end-user crate (smart-leds) simplifies building LED projects on embedded hardware using the embedded-hal ecosystem. The project also offers sample code and supports various microcontrollers like SAMD21 and STM32.
Key Features
Supports WS2812 and APA102 addressable LEDs
SPI-based drivers for ws2812 and apa102
Timer-based delay driver for ws2812
Trait system for implementing effects, modifiers, and drivers
Sample code collection for various LED projects
Nop-delay bitbangers for SAMD21 and SAMD51 microcontrollers
Open source under Apache-2.0 license
Pros & Cons
Pros
- Open source with permissive Apache-2.0 license
- Multiple driver options (SPI, timer, nop-delay) for flexibility
- Trait-based design allows reusable and composable effects
- Active development with recent commits
- Includes sample code to accelerate development
- Leverages the embedded-hal ecosystem for portability
Cons
- Requires knowledge of Rust and embedded systems programming
- No visual programming or GUI interface
- Limited to microcontrollers supported by embedded-hal
- Documentation may be sparse for beginners
- No direct support for non-Rust platforms
Best For
Controlling RGB LED strips in embedded Rust projectsCreating animated lighting effects for IoT devicesBuilding LED matrices and displaysEducational projects for learning embedded RustPrototyping LED-based hardware with microcontroller boards
FAQ
What types of LEDs are supported?
The smart-leds-rs project primarily supports WS2812 (NeoPixel) and APA102 (DotStar) addressable LEDs.
What is the license for these crates?
All repositories in the smart-leds-rs organization are licensed under the Apache-2.0 license.
How do I get started with smart-leds?
You can start by adding the 'smart-leds' crate to your Cargo.toml. The repository includes sample code in smart-leds-samples to help you begin.
Which microcontrollers are supported?
Drivers are available for various microcontrollers, including SAMD21, SAMD51, STM32, and any MCU that supports embedded-hal SPI or timer peripherals.