Tactile Button Switch
Signal Type:
Binary (on/off)
IDeATe Component Number:
Makes an electrical connection when pressed.
Tactile Button Switch

Push-button switches are the classic momentary switch, as they only remain in their "on" state as long as they’re being actuated (pressed, held, etc). (adapted from Sparkfun)

When pressed, the tactile button switches connect two points in a circuit by allowing electricity to flow through. Tactile Button Switches have four pins, which can be a little confusing but because pins B and C are connected together as well as A and D, there are only really two electrical connections. (adapted from Adafruit)

Getting started
Adafruit Arduino - Lesson 6. Inputs


int ledPin = 5;
int buttonApin = 9;
int buttonBpin = 8;

byte leds = 0;

void setup()
  pinMode(ledPin, OUTPUT);
  pinMode(buttonApin, INPUT_PULLUP);
  pinMode(buttonBpin, INPUT_PULLUP);

void loop()
  if (digitalRead(buttonApin) == LOW)
    digitalWrite(ledPin, HIGH);
  if (digitalRead(buttonBpin) == LOW)
    digitalWrite(ledPin, LOW);
Related Components