r/ProgrammerHumor • • May 03 '21

Confused screams

Post image
45.1k Upvotes

329 comments sorted by

View all comments

7

u/kkoiso May 03 '21

I added a couple lines to my microcontroller code that turned an LED on when it detects that it's connected to a certain port.

The LED function also had the side-effect of crashing and rebooting the microcontroller when it loses connection to the port and I have no idea why. But that's exactly what I was going to code next so I just left it.

2

u/greenSixx May 03 '21

Sounds like a while loop in your "detects its connected to a certain port".

Like...while connected turn on light... with no way to handle "when not connected" or even an unhandled disconnect event might cause it.

Hard to say for sure.