5011as 7-segment display driver for Rust
This library provides a very simple driver for the 5011as 7-segment display.
This crate provides 2 drivers for the display:
LED5011AS: Use this if all your pins have the same type (e.g.OutputPin<'_>)GenericLED5011AS: Use this if your pins don't have the same type (e.g.OutputPin<'_>andFlex<'_>(from esp-hal))
This is the pin layout for the display:
Usage
For this example I'm using an ESP32 C6 with esp-hal with the LED5011AS driver.
// setup pins
let peripherals = init;
let cfg = default;
let mut a = new;
let mut b = new;
let mut c = new;
let mut d = new;
let mut e = new;
let mut f = new;
let mut g = new;
let mut dp = new;
// create LED5011AS
let mut display = LED5011ASnew;
// set a digit
display.set_digit?;
display.set_digit?; // overrides the '3' so you don't have to clear the display inbetween
// clear the display
display.clear?;
// write a custom figure to the display
display.write_byte?; // writes an 'A' to the display
License
This project is licensed under the Apache License 2.0.