Ks0112 keyestudio EASY plug Digital Push Button: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
==EASY plug Digital Push Button ==
[[image:ks0112图.jpg|thumb|600px|right|Keyestudio EASY plug Digital Push Button]]
<br>[[File:ks0112-1.png|500px|frameless|thumb]]<br>


==Introduction==
==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.<br>
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 module needs to be used together with EASY plug control board.<br>
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==
* Interface: Easy plug
* Connector: Easy plug
* Supply Voltage: 3.3V to 5V
* Supply Voltage: 3.3V to 5V
* Large button keypad and high-quality first-class cap
* Large button and high-quality top cap
* Standard assembling structure (two 3mm diameter holes with multiple of 5mm as distance from center)
* Sensor type: Digital
* Sensor type: Digital
* Size: 38*20mm
* Weight: 6g


==Connection Diagram ==
<br>
<br>[[File:ks0112-2.png|500px|frameless|thumb]]<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>


==Sample Code==
<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.
/* 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 ledPin = 13;// choose the pin for the LED
int inputPin = 11;               // Connect sensor to input pin 11
int inputPin = 9;// Connect sensor to input pin 9
void setup() {
void setup() {
pinMode(ledPin, OUTPUT);     // declare LED as output
pinMode(ledPin, OUTPUT);// declare LED as output
pinMode(inputPin, INPUT);     // declare pushbutton as input
pinMode(inputPin, INPUT);// declare pushbutton as input
}
}
void loop(){
void loop(){
int val = digitalRead(inputPin); // read input value
int val = digitalRead(inputPin);// read input value
if (val == HIGH) {           // check if the input is HIGH
if (val == HIGH) { // check if the input is HIGH
  digitalWrite(ledPin, LOW); // turn LED OFF
digitalWrite(ledPin, LOW);// turn LED OFF
} else {
} else {
  digitalWrite(ledPin, HIGH); // turn LED ON
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


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

Keyestudio EASY plug Digital Push Button

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.
thumb


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.
thumb thumb


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