The vacuum pump is turned on via a relay that is activated by the Arduino pushing 5 volts to it and then the relay switches over to 120V power to turn on the pump. This part of my program works (I have witnessed it turn on the Pump), so can we please focus on my issue at hand please. The code I know is readable to the Arduino. My issue at the moment is that my push button is in a constant state of LOW When I need it to be flexible and read between the state of LOW and HIGH. Is it not doing this because I have not defined it as a variable that will change in my code at the top?The only things in my code that do not work are the push button to start the program and the proximity sensor to make the program wait before moving on to waiting on the button to be pushed. One thing at a time though. I need to focus on my push button for now
so can we please focus on my issue at hand please.
if (vacuumpumpPin == HIGH)
My issue at the moment is that my push button is in a constant state of LOW When I need it to be flexible and read between the state of LOW and HIGH.
You did a good job of the drawing but this is a wiring diagram, not a schematic.
I think I figured it out.The button I am using is a momentary push button that is normally CLOSED. So since it is connected to ground on the other end of the button, that means that while the button is not pressed, it will read LOW (0), but when I do press the button, it breaks the connection to ground and should then read HIGH.
If I have the button initially grounded, then the Arduino may not be able to set up the PULLUP resistor because it is reading a LOW off of it right from the start, given it is connected to ground.