Ks0112 keyestudio EASY plug Digital Push Button: Difference between revisions
Keyestudio (talk | contribs) |
Keyestudio (talk | contribs) |
||
Line 61: | Line 61: | ||
==Buy from == | ==Buy from == | ||
'''Official Website''' | *'''Official Website:''' http://www.keyestudio.com/ks0112.html | ||
http://www.keyestudio.com/ | |||
*[https://www.aliexpress.com/store/product/New-Keyestudio-EASY-Plug-Digital-Push-Button-for-Arduino/1452162_32643204056.html?spm=2114.12010612.8148356.10.64de484e0lsdsr Shop on aliexpress] | |||
[[category:EASY Plug]] | [[category:EASY Plug]] |
Revision as of 14:40, 22 November 2018
Introduction
The EASY Plug Push-button module is a tidy little design that lets you control a DC power source using an everyday tactile button.
This basic application module is widely applied to Arduino, Raspberry Pi platforms.
When the button is pressed, it outputs HIGH level signal; if release the button, it outputs LOW level signal.
You can simply connect to an IO port to have your first taste of Arduino.
Note: this sensor needs to be used together with EASY plug control board.
Specification
- Connector: Easy plug
- Supply Voltage: 3.3V to 5V
- Large button and high-quality top cap
- Sensor type: Digital
Technical Details
- Dimensions: 38mm*20mm*18mm
- Weight: 5.6g
Connect It Up
Connect the EASY Plug Push Button sensor to control board using an RJ11 cable. Then connect the control board to your PC with a USB cable.
Upload the Code
Copy and paste below code to Arduino IDE and upload.
/* 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 = 9;// Connect sensor to input pin 9 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 } }
What You Should See
Powered up and upload well the code, press down the button, D13 indicator on the control board is turned on. While release the button, indicator LED is off.
Resources
Download the PDF:
https://drive.google.com/open?id=1n231PI2jg8BQcIFIccbpYRfGLHEpQoP0
Buy from
- Official Website: http://www.keyestudio.com/ks0112.html