My graduation cap runs Rust

· coding · Source ↗

TLDR

  • Purdue CS student built a reed-switch-triggered WS2812B LED array on a rental graduation cap, firmware written in Rust on an ATtiny85.

Key Takeaways

  • Stack: Digispark ATtiny85, 48 WS2812B LEDs, reed switch and magnet for tassel detection, USB-C PD trigger board, power bank.
  • avr-hal and ws2812-avr lack ATtiny85 support by default; required forking both crates and patching the default clock to 16 MHz.
  • Hardware assembly took 3+ hours vs 2 hours for firmware; wiring sourced from a stripped Apple USB-C cable.
  • Chose ATtiny85 over ESP32 for size and weight; decided against wearing it due to aesthetics.
  • Code is open source at github.com/ericswpark/gradcap-rs.

Hacker News Comment Review

  • Thin discussion; one commenter sees skipping the live wear as a missed opportunity for a memorable public moment and career-story origin.

Original | Discuss on HN