DFRobot_Digital_Push_Button_(SKU_DFR0029) - jimaobian/DFRobotWiki GitHub Wiki

Introduction

DFRobot Digital Push Button this is a big button which gives the first touch of the physical world. simply plug to IO expansion board to finish your first taste of Arduino.

Features

  • Digital push button sensor
  • Easy to 'plug and play'
  • Large button keypad and high-quality first-class hat

Pin Definition

Big button module pin definition :

:#Input

:#Power

:#GND

Connection Diagram

Digital module connection diagram

Sample Code

///Arduino Sample Code
///www.DFRobot.com
///Last modified on 16th September 2010

int ledPin = 13;                // choose the pin for the LED
int inputPin = 3;               // Connect sensor to input pin 3


void setup() {
  pinMode(ledPin, OUTPUT);      // declare LED as output
  pinMode(inputPin, INPUT);     // declare pushbutton as input
}

void loop(){
  int val = digitalRead(inputPin);  // read input value
  if (val == HIGH) {            // check if the input is HIGH
    digitalWrite(ledPin, LOW);  // turn LED OFF
  } else {
    digitalWrite(ledPin, HIGH); // turn LED ON
  }
}

image:nextredirectltr.pngGo shopping dfrobot digital push button (sku:dfr0029)

category: Product Manual category: DFR Series