Switches and push buttons: Difference between revisions
From wikiluntti
| Line 8: | Line 8: | ||
A double pole single throw push button micro switch (DPST) is a widely used button. Push button switches are often color coded to indicate their function. | A double pole single throw push button micro switch (DPST) is a widely used button. Push button switches are often color coded to indicate their function. | ||
Three methods to wire | |||
# Internal resistor: Use <code>INPUT_PULLUP</code> in setup <code>pinMode( Button_pin, INPUT_PULLUP);</code> | |||
# | |||
# The bad method: | |||
Revision as of 11:15, 23 July 2023
Introduction
Theory A: Simple switch
Theory B: Push Button

A double pole single throw push button micro switch (DPST) is a widely used button. Push button switches are often color coded to indicate their function.
Three methods to wire
- Internal resistor: Use
INPUT_PULLUPin setuppinMode( Button_pin, INPUT_PULLUP); - The bad method: