Can someone tell me if the switch that is located here is the same as the one that is used in this tutorial found here. It is a trivial part but if it stops you project then it can be deadly too....
In the tutorial there is an image of a momentary switch (that switch with the red button) but the fritzing schematic shows a toggle switch.The function will be the same but the ‘red’ switch will pull the line high as long as it is pushed, but the toggle switch will hold its position.… does this answer your question?
Does it mean that if I use a momentary switch, the motors will run only as long as I keep the switch presssed? If yes, then it is a problem. Why do we need a switch in the circuit in the first place?
The switch is used to drive the motor forward or backward as it says in the article:
"In the main loop(). read the switch. If it's high, turn the motor one way by taking one H-bridge pin high and the other low. If the switch is low, reverse the direction by reversing the states of the two H-bridge pins."
If you need the switch or not depends on your application. If you build a robot the switch may be insufficient since the robot must change direction from within the programmed behavior. If you build a motor test bench the switch might be sufficient.
Ohk, I've posted my bot here (if you can call it a bot)...