Skip to content

DFRobot_Digital_Push_Button_SKU_DFR0029

Angelo edited this page Sep 21, 2016 · 3 revisions

Digital Push Button

Introduction

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.

Improvement List

  • Wide voltage range from 3.3V to 5V
  • Standard assembling structure (two 3mm diameter holes with multiple of 5mm as distance from center)
  • Easily recognitive interfaces of sensors ("A" for analog and "D" for digital)
  • Icons to simplely illustrate sensor function
  • High quality connector
  • Immersion gold surface

Specification

  • Supply Voltage: 3.3V to 5V
  • Indicator LED on board
  • Easy to 'plug and play'
  • Large button keypad and high-quality first-class hat
  • Able to achieve very interesting and an interactive work
  • Interface: Digital
  • Size:22x30mm

Connection Diagram

connection diagram

Sample Code

/*
  # Description:
  # When you push the digital button, the Led 13 on the board will turn on. Otherwise,the led turns off.
*/
int ledPin = 13;                // choose the pin for the LED
int inputPin = 2;               // 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
  }
}

Version History

Digital Push Button V1

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

category: Product Manual category: DFR Series

Clone this wiki locally