My axiom that all bugs are a result of condtional code is morphing into all bugs are a result of LLM generated code. For the latest one: it does not understand that mutable variables mutate if you actually mutate them. And you can’t use their old value afterwards unless you store it in a temp first. I think I will now ban it from using mutable variables and only allow it to write pure functions. Maybe this is going to force us all to embrace FP once and for all. #progamming



![[ImageSource: Wjen]
The light in question is a Phillips Hue Ambiance, and [Wjen]’s excellently-documented six part series takes us through the process of creating a replacement light driver. It’s a good read, including reverse-engineering the PWM functions to get the lights to dim exactly like stock, and a dive into the Zigbee protocol so his rebuild light could still talk to the Philips Hue hub.
The firmware [Wjen] wrote for the ESP32C6 he chose to use for this project is on GitHub, with the PCB in a second repo.
<https://github.com/wejn/e32wamb>
<https://github.com/wejn/e32wamb-pcb/>](https://files.mastodon.social/cache/media_attachments/files/114/840/426/034/612/131/small/b43430e498b24e7a.jpeg)

![Months of work have gone into decoding the Game Boy’s data bus and creating a schematic for the interface board. Tricking the Game Boy into thinking it was loading a game, while actually displaying incoming speed data. The screen’s low resolution and slow refresh rate rendered it barely readable in a moving vehicle. But [John]’s goal wasn’t practicality — it was just proving it could be done.](https://files.mastodon.social/cache/media_attachments/files/114/251/512/843/600/593/small/7e34d3705bf22908.jpeg)
![[ImageSource: John Sutley]
Showing real-time vehicle speed on the Game Boy sounds like it should be relatively easy, but the iconic game system wasn’t exactly built for such a task. Its 2 MHz CPU and 160×144 pixel dot-matrix screen were every kid’s dream in 1989, but using it as a car dashboard is pushing it. To bridge that gap, [John] designed two custom circuit boards.
One interfaces with the Game Boy, intercepting its memory requests and feeding it data from a microcontroller. The other processes the CAN bus signals, translating speed information into a form the Game Boy can display. [John] used inexpensive tools and software to read the CAN bus data, and used GBDK-2020 to write the software in C.](https://files.mastodon.social/cache/media_attachments/files/114/251/512/881/442/605/small/1f29d22707290411.png)

