-
Notifications
You must be signed in to change notification settings - Fork 5
DFRobot_Digital_Push_Button_(SKU_DFR0029)
Angelo edited this page Sep 21, 2016
·
3 revisions
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.
- Digital push button sensor
- Easy to 'plug and play'
- Large button keypad and high-quality first-class hat
Big button module pin definition :
:#Input
:#Power
:#GND
///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
}
}