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.
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
Connecting Diagram
Sample Code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
///Arduino Sample Code///www.DFRobot.com///Last modified on 16th September 2010int ledPin = 13; // choose the pin for the LEDint 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(){ 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 }} |




