Writing code, blinking an LED with a Raspberry Pi

Originally published at: https://contextualelectronics.com/lessons/writing-code-blinking-an-led-with-a-raspberry-pi/

Configuring GPIO on a Raspberry Pi Example code we used

Hey @ChrisGammell (or anyone readlly) I worked through this project over the weekend and watched this video tonight.

When Chris first hooks up the Shine On board, there is some voltage leakage that is mentioned that is causing the uninitialized led to light just slightly.

My question:
Is the a simple hardware design fix to prevent this and keep the led completely off until it was used?

Thanks
Robert

I suppose it’s possible to put a very high value pull down or pull up resistor to ground to ensure that there is some connection to a rail or ground. However, this would introduce issues later, burning unnecessary current and making the circuit unnecessarily complicated. The best thing to do is to properly initialize all pins in the first place :smiley: