I'm doing the Button Arduino example and I've got a likely technical question on why the whole resistor needs to be used.
This video from the Maker Shed is very good and starts explaining why at 2:25, but I've still got questions.
First of all, I think it would make perfect sense (like the narrator in the video says wouldn't make sense) to simply hook the pin up to 5v and put the button in between.
After that, he goes on to explain that when the button is unpressed, the electricity comes out of the pin and into the ground. I thought the pin was sensing the electricity coming in. Again, when the button is pressed, it comes out and goes into the 5v. You'd think the 5v is the one sending out the energy. (I understand that a resistor is used because when the button is closed it is easier to go through the button instead of the resistor).
Is this because the pin also measures electricity getting "sucked out" of it, and if you don't anything hooked up to it when the button is open, it varies with the random noise it's sensing?
I suppose this likely has to do with the deep subject of what direction does the electricity flow (from the + to - or vise versa). I have searched on that topic and have found some answers, but maybe not enough, as I must ask this question. So I'll see what people say and provide some feedback to what I know.
Thanks!