My graduation cap runs Rust

12 May 2026

I have never graduated before. I mean, since college. So the whole cap and gown thing is new to me.

Fun Fact #1: You rent your cap and gown in America. You have to return them. And they are expensive too! I paid $94 just for the privilege of renting mine, which is crazy because they probably cost much less to build than that. What if, say, you say you’re OK without the cap and gown? Okay, so you can’t walk into the ceremony. So you have to spend money to hire them. And they don’t give you the option to buy the cap and gown outright.

Okay, this is not such a fun fact. how about:

Fun Fact #2: When you graduate, they move your pendant from right to left to represent something… why not left to right? What about left handed people?! Why are graduation ceremonies discriminating against left handed people?!

still. I was thinking about fun fact #2, and then I thought it might be cool if my hat lit on fire because whoever it is rocks my tassel. But section 98.C.2 of the rental agreement probably prevents it, and I don’t think Purdue would like it very much if I set fire to the stage.

Hmm. What if I create a device that detects when the tassel is removed and illuminates the bottom of the hat?

And with that, I had to come up with this crazy idea. And the end result is beautiful if I do say so myself:

FAQ

What parts did you use?

  • A DigiSpark ATtiny85
  • 48 WS2812B LED
  • Wires removed from faulty Apple USB-C-to-C cable
  • Reed switch and magnet to detect tassel movement (not shown in demo)
  • A USB-C Power Delivery Trigger Board
  • Power Bank (and USB-C Cable)

How much time did you spend on this thing?!

It took about 2 hours to write the code, mostly because avr-hal And ws2812-avr
Don’t support ATtiny85 out of the box, at least not without some changes. I had to fork them and do a few things dirty, including setting the default clock speed to 16 MHz.

It probably would have been easier if I didn’t use Rust and just used the Arduino library, or if I used a different board. But I was really hooked on this blog post title idea, and I was pretty sure the ESP32 board would be oversized and wouldn’t fit properly on the cap.

The hardware side took the most time, 3+ hours. If someone tells you hardware is easy they are wrong or they are lying and have never worked on a custom hardware project!

Are you really going to wear this to your graduation?

heck no.

I thought about it but decided it seemed too tacky. It seems like what the kids will think of as a gaming PC the boomers will think of as a seizure.

Speaking of seizures, there was indeed a missed opportunity…

…Missed?

WARNING: The following video contains light-fast rotation. I wrote this so that people reading this with a screen reader know that they should NOT watch the video!

WKUK eat to your heart’s content

Can I see the code?

https://github.com/ericswpark/gradcap-rs




<a href

Leave a Comment