An embedded Rust experiment driving a 7-segment LED display using an ESP32 and the esp-hal
crate.
This is a fun little project to explore
#![no_std]
development with Rust on ESP32, and how to animate a 7-segment display.
- Count from
0
toF
in hexadecimal - Circular segment animation (
circle
) - Snake-style effect across segments (
snake_eight
) - Simple sequence lighting demo (
sequence
) - Modular display logic
- ESP32 development board
- Common cathode 7-segment LED display
- 8 GPIO-connected resistors (1 per segment)
- Breadboard and jumper wires
- USB cable and UART for flashing
esp-hal
— Hardware Abstraction Layer for ESP chipsesp-backtrace
— for panic handlingno_std
,no_main
,#[entry]
fromesp-hal-macros
_
|_|
|_|
Segment Indexes:
1
0 2
3
4 6
5 .7 (dot)
count
– display digits 0–F one at a timesnake_eight
– animates a snake-like motion over the digit "8"circle
– moves a lit segment in a circular motionsequence
– turns on each segment in order
Each function demonstrates basic GPIO manipulation and delay usage in a no_std
context.