Difference between revisions of "Button Module"

From LinkSprite Playgound
Jump to: navigation, search
(Created page with "<pre> /* Button Turns on and off a T010111 LED Module connected to O0 (digital pin 11), when pressing a T000180 pushbutton attached to I0 (analog pin 0). created 20...")
 
(Features)
 
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<pre>
+
==Introduction==
 +
This button module hosts momentary push button switch - 12mm Square. It can serve as input for Arduino experiment.
  
/*
+
[[File:Linker button.jpg]]
  Button
 
  
Turns on and off a T010111 LED Module connected to O0 (digital 
+
== Features ==
pin 11), when pressing a T000180 pushbutton attached to I0 (analog pin 0).
 
  
created 2005
+
Dimensions: 26.0×25.0×10.9mm
by DojoDave <http://www.0j0.org>
 
modified 17 Jun 2009
 
by Tom Igoe
 
modified 7 dec 2010
 
by Davide Gomba
 
  
This example code is in the public domain.
+
Net weight: 3.4g
  
based on  http://www.arduino.cc/en/Tutorial/Button
+
== Dimension ==
*/
 
  
#define O0 11
+
[[File:button dimension.jpg]]
#define O1 10
 
#define O2 9
 
#define O3 6
 
#define O4 5
 
#define O5 3
 
#define I0 A0
 
#define I1 A1
 
#define I2 A2
 
#define I3 A3
 
#define I4 A4
 
#define I5 A5
 
  
// constants won't change. They're used here to
+
== Schematics ==
// set pin numbers:
+
*[https://s3.amazonaws.com/linksprite/LinkerKit/Linker+button.pdf Schematics]
const int buttonPin = I0;    // the number of the pushbutton pin
 
const int ledPin =  O0;      // the number of the LED pin
 
  
// variables will change:
+
== Application Ideas ==
int buttonState = 0;        // variable for reading the pushbutton status
 
  
 +
<syntaxhighlight lang="c">
 +
 +
const int ButtonPin=9;
 
void setup() {
 
void setup() {
  // initialize the LED pin as an output:
+
   pinMode(ButtonPin, INPUT);
   pinMode(ledPin, OUTPUT);    
+
   Serial.begin(9600);       // init serial to 9600b/s
   // initialize the pushbutton pin as an input:
 
  pinMode(buttonPin, INPUT);    
 
 
}
 
}
 +
 +
void loop() {
 +
  int sensorValue = digitalRead(ButtonPin);
 +
  if(sensorValue==1)
 +
  {
 +
    Serial.println("High");   
 +
  }
 +
  else
 +
  {
 +
    Serial.println("Low");   
 +
   
 +
  }
 +
}
  
void loop(){
+
</syntaxhighlight>
  // read the state of the pushbutton value:
 
  buttonState = digitalRead(buttonPin);
 
 
 
  // check if the pushbutton is pressed.
 
  // if it is, the buttonState is HIGH:
 
  if (buttonState == HIGH) {   
 
    // turn LED on:   
 
    digitalWrite(ledPin, HIGH); 
 
  }
 
  else {
 
    // turn LED off:
 
    digitalWrite(ledPin, LOW);
 
  }
 
}
 
  
 +
[[File:Button link.jpg]]
  
</pre>
+
==How to buy==
 +
Here to buy Button Module on [http://store.linksprite.com/button-module-of-linker-kit-for-pcduino-arduino/ store]

Latest revision as of 01:29, 13 June 2014

Introduction

This button module hosts momentary push button switch - 12mm Square. It can serve as input for Arduino experiment.

Linker button.jpg

Features

Dimensions: 26.0×25.0×10.9mm

Net weight: 3.4g

Dimension

Button dimension.jpg

Schematics

Application Ideas

<syntaxhighlight lang="c">

const int ButtonPin=9; void setup() {

 pinMode(ButtonPin, INPUT);
 Serial.begin(9600);        // init serial to 9600b/s

}

void loop() {

 int sensorValue = digitalRead(ButtonPin);
 if(sensorValue==1)
 {
   Serial.println("High");    
 }
 else
 {
   Serial.println("Low");     
   
 }
}

</syntaxhighlight>

Button link.jpg

How to buy

Here to buy Button Module on store