RaspberryPiBeginners wrote:Gordon you say
If you arrange the buttons to short the gpio pin to ground, then you enable the internal pull-up resistor on the pin then it'll work just fine
This is what I've done right?
It's not wrong, however...
In the image above, you have 2 resistors per button -
+3.3v - Button - GPIO - 10K - 0V
So this is biasing the input pin to ground, and will connect it to +3.3 when the button is pushed. (well, to 2.75V which will register as "high").
You can optimise this in 2 ways. The first is to just use one resistor like this:
+3.3 - 10K resistor - GPIO - button - 0V
That way it will bias the input high and take it to 0V when you push the button. The logic input is the other way round, (ie. read 1 when open, 0 when pushed) but we can fix that in software.
The 2nd way to optimise it is to know that the BCM chip has internal resistors that you can configure in software. So if you configure an internal resisor to connect the pin to +3.3v then all you need is:
GPIO - button - 0V
and it works like the method above, but with no resistors.
RaspberryPiBeginners wrote:I'm planning on creating a new video with an updated/safer board layout and also adding a web interface for control. I want to ensure it's 100% correct before I put it out there again.
Thanks again everyone, is it correct yet...my board that is?
Your circuit will work - no question about that, but is it "optimal", and does it really matter if it's optimal or not?
It is "safe" in that if you accidentally program the pin as output and set it high, then it's not going to do much, button pressed or not, but if you were making a million of them and could save a penny a resistor, then ...
I also notice in the picture, your using GPIO 0 and GPIO 1 for the button inputs. I'm suspecting you really mean BCM_GPIO 17 and BCM_GPIO 18 as 0 and 1 are the I2C pins and these already have 1.8K resistors to +3.3V.
In my infinite wisdom, I renumbered the GPIO pins in my wiringPi code to be more Arduino Like and got whinged at, but for Arduino users it makes more sense than the "native" GPIO numbering does. What doesn't help is that the original drawing of the GPIO on the wiki refered to them as starting at zero too... Just stick to pictures, that's what I reckon

-Gordon