Ks0112 keyestudio EASY plug Digital Push Button: Difference between revisions
Keyestudio (talk | contribs) |
Keyestudio (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
[[image:ks0112图.jpg|thumb|600px|right|Keyestudio EASY plug Digital Push Button]] | |||
==Introduction== | ==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.<br> | |||
Note: this | This basic application module is widely applied to Arduino, Raspberry Pi platforms.<br> | ||
When the button is pressed, it outputs HIGH level signal; if release the button, it outputs LOW level signal.<br> | |||
You can simply connect to an IO port to have your first taste of Arduino.<br> | |||
<span style="color: red">'''Note: ''' this sensor needs to be used together with EASY plug control board.<br> | |||
<br> | |||
==Specification== | ==Specification== | ||
* | * Connector: Easy plug | ||
* Supply Voltage: 3.3V to 5V | * Supply Voltage: 3.3V to 5V | ||
* Large button | * Large button and high-quality top cap | ||
* Sensor type: Digital | * Sensor type: Digital | ||
== | <br> | ||
==Technical Details== | |||
* Dimensions: 38mm*20mm*18mm | |||
* Weight: 5.6g | |||
<br> | |||
==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. | |||
<br>[[File:ks0112.jpg|500px|frameless|thumb]]<br> | |||
== | <br> | ||
==Upload the Code== | |||
Copy and paste below code to [http://wiki.keyestudio.com/index.php/How_to_Download_Arduino_IDE Arduino IDE] and upload. | |||
<pre> | <pre> | ||
/* | /* When you push the digital button, the Led 13 on the board will turn on. Otherwise,the led turns off. | ||
*/ | */ | ||
int ledPin = 13; | int ledPin = 13;// choose the pin for the LED | ||
int inputPin = | int inputPin = 9;// Connect sensor to input pin 9 | ||
void setup() { | void setup() { | ||
pinMode(ledPin, OUTPUT);// declare LED as output | |||
pinMode(inputPin, INPUT);// declare pushbutton as input | |||
} | } | ||
void loop(){ | 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 | |||
} | |||
} | } | ||
</pre> | </pre> | ||
<br> | |||
==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. | |||
<br>[[File:ks0112 Result.jpg|500px|frameless|thumb]] [[File:ks0112 Result1.jpg|500px|frameless|thumb]]<br> | |||
<br> | |||
==Resources == | ==Resources == | ||
'''PDF''' | '''PDF''' | ||
https://drive.google.com/open?id=1n231PI2jg8BQcIFIccbpYRfGLHEpQoP0 | https://drive.google.com/open?id=1n231PI2jg8BQcIFIccbpYRfGLHEpQoP0 | ||
<br> | |||
==Buy from == | ==Buy from == | ||
'''Official Website''' | '''Official Website''' | ||
http://www.keyestudio.com/keyestudio-easy-plug-digital-push-button-for-arduino.html | |||
[[category:EASY Plug]] | [[category:EASY Plug]] |
Revision as of 10:16, 16 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
PDF https://drive.google.com/open?id=1n231PI2jg8BQcIFIccbpYRfGLHEpQoP0
Buy from
Official Website http://www.keyestudio.com/keyestudio-easy-plug-digital-push-button-for-arduino.html