Ks0029 keyestudio Digital Push Button: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
No edit summary
Line 24: Line 24:


==Sample Code ==
==Sample Code ==
<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.
Line 41: Line 39:
   } else {
   } else {
     digitalWrite(ledPin, HIGH); // turn LED ON
     digitalWrite(ledPin, HIGH); // turn LED ON
}</pre>
}
</pre>
 
== Test ==
<br>[[File:KS0029 (8).jpg|500px|frameless|thumb]]<br>  


==Resources ==
==Resources ==
Line 53: Line 55:
https://drive.google.com/open?id=1Uqi1u2NuQ83Nh56HhyIEIkPj1ix7jM8x
https://drive.google.com/open?id=1Uqi1u2NuQ83Nh56HhyIEIkPj1ix7jM8x


==Buy from ==
==Buy From ==
'''Official Website'''
'''Official Website'''



Revision as of 13:51, 15 November 2017

Introduction

This is a basic application module. You can simply plug it into an IO shield to have your first try of Arduino. 
Advantages:

  • Wide voltage range from 3.3V to 5V
  • Standard assembling structure (two 3mm diameter holes with multiple of 5mm as distance from center)
  • Easily recognizable interfaces of sensors ("A" for analog and "D" for digital)
  • Icons illustrate sensor function clearly
  • High quality connector
  • Immersion gold surface


thumb

Specification

  • Supply Voltage: 3.3V to 5V
  • Easy to plug and operate
  • Large button keypad and high-quality first-class cap
  • Achieve interesting and interactive works
  • Interface: Digital
  • Size: 30*20mm
  • Weight: 4g

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 = 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(){
  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
}

Test


thumb

Resources

Video

http://www.keyestudio.com/wp/2016/05/ks0029-keyestudio-digital-push-button-module/

PDF

https://drive.google.com/open?id=1Uqi1u2NuQ83Nh56HhyIEIkPj1ix7jM8x

Buy From

Official Website

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