Ks0112 keyestudio EASY plug Digital Push Button: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
(Created page with "==EASY plug Digital Push Button == <br>500px|frameless|thumb<br> ==Introduction== This is a basic application module widely applied in Arduino, Raspberr...")
 
No edit summary
Line 40: Line 40:
}
}
</pre>
</pre>
==Resources ==
'''Datasheet'''
http://www.keyestudio.com/files/index/download/id/1464061756/
==Buy from ==
http://www.keyestudio.com/keyestudio-easy-plug-digital-push-button-for-arduino.html


[[category:Module]]
[[category:Module]]

Revision as of 09:26, 16 February 2017

EASY plug Digital Push Button


thumb

Introduction

This is a basic application module widely applied in Arduino, Raspberry Pi platforms. When the button is pressed, it outputs high level signal; when you release the button, it outputs low level signal. You can simply plug it into an IO port to have your first taste of Arduino.
Note: this module needs to be used together with EASY plug control board.


Specification

  • Interface: Easy plug
  • Supply Voltage: 3.3V to 5V
  • Large button keypad and high-quality first-class cap
  • Standard assembling structure (two 3mm diameter holes with multiple of 5mm as distance from center)
  • Sensor type: Digital
  • Size: 38*20mm
  • Weight: 6g


Connection Diagram


thumb


Sample Code

/* # 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 = 11;               // Connect sensor to input pin 11
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
 }
}

Resources

Datasheet

http://www.keyestudio.com/files/index/download/id/1464061756/

Buy from

http://www.keyestudio.com/keyestudio-easy-plug-digital-push-button-for-arduino.html