Difference between revisions of "Button Module"

From LinkSprite Playgound
Jump to: navigation, search
(Features)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<syntaxhighlight lang="c">
+
==Introduction==
/*
+
This button module hosts momentary push button switch - 12mm Square. It can serve as input for Arduino experiment.
  Button
+
 
 +
[[File:Linker button.jpg]]
 +
 
 +
== Features ==
  
Turns on and off a T010111 LED Module connected to O0 (digital 
+
Dimensions: 26.0×25.0×10.9mm
pin 11), when pressing a T000180 pushbutton attached to I0 (analog pin 0).  
 
  
created 2005
+
Net weight: 3.4g
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.
+
== Dimension ==
  
based on  http://www.arduino.cc/en/Tutorial/Button
+
[[File:button dimension.jpg]]
*/
 
  
#define O0 11
+
== Schematics ==
#define O1 10
+
*[https://s3.amazonaws.com/linksprite/LinkerKit/Linker+button.pdf Schematics]
#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
+
== Application Ideas ==
// set pin numbers:
 
const int buttonPin = I0;    // the number of the pushbutton pin
 
const int ledPin = O0;      // the number of the LED pin
 
  
// variables will change:
+
<syntaxhighlight lang="c">
int buttonState = 0;        // variable for reading the pushbutton status
 
  
 +
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.
+
[[File:Button link.jpg]]
  // if it is, the buttonState is HIGH:
 
  if (buttonState == HIGH) {   
 
    // turn LED on:   
 
    digitalWrite(ledPin, HIGH); 
 
  }
 
  else {
 
    // turn LED off:
 
    digitalWrite(ledPin, LOW);
 
  }
 
}
 
  
 
+
==How to buy==
</syntaxhighlight>
+
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