Expand description
This Rust crate provides support for the Elecfreaks Wukong Expansion Board (Wukong; see also their wiki) for the BBC micro:bit v2 (MB2).
This crate is currently built atop nrf52833-hal
and is
probably best used with that.
The Wukong provides a rechargeable battery that can power itself and the MB2, and provides expansion pins for 5V and for the MB2 edge connector.
The Wukong also provides five mostly-disjoint features visible from the MB2. Each is supported by a separate Cargo feature listed here. (All features are on by default, but you can turn off the ones you don’t want to save a little space.) The names were mostly taken from the Wukong documentation.
-
“Ambient” LEDs (
ambient
): Four WS2812 RGB “Smart LEDs” sit at the four corners of the Wukong. This crate will drive these LEDs as if they were directly addressable. -
“Buzzer” (
buzzer
): A speaker sits on the bottom of the board. This crate will play a square wave at a given frequency on this speaker. -
Mood Lights (
mood_lights
): There are blue LEDs under the board that are cooperatively controlled by the Wukong and the MB2. (These are referred to as “Breath” in the Wukong documentation, but they can be put in steady-on mode as well.) This crate can run these. -
Motor (
motor
): The Wukong has two DC motor controllers with pins on the board. This crate can set the speed of these motors. -
Servo (
servo
): The Wukong has eight servo controllers with pins on the board. This crate can set the angle of these servos.
Re-exports§
pub use ambient::WuKongAmbient;
pub use buzzer::WuKongBuzzer;
pub use bus::WuKongBus;
pub use bus::MoodLights;
pub use bus::Motor;
pub use bus::Servo;
pub use bus::ServoAngle;
pub use bus::ServoConfig;
Modules§
- ambient
- Driver for four “Ambient” LEDs near the four corners of the Wukong board. These are WS2812-family “smart” LEDs — they appear to be WS2812B.
- bus
- Driver for Wukong I2C bus. This bus is used to control the Mood Lights, Motors and and Servos.
- buzzer
- Buzzer driver for Wukong. The “buzzer” is a small magnetic speaker mounted on the bottom of the Wukong board. This code allows sending a square wave to this speaker at a frequency corresponding to a given MIDI key number. It can be used to play tunes, or just as a beeper.
Type Aliases§
- RGB8
- 8-bit RGB