Difference between revisions of "Tilt Module"

From LinkSprite Playgound
Jump to: navigation, search
(Created page with "<syntaxhighlight lang="c"> /* Tilt Turns on and off a T010111 LED Module connected to O0 (digital pin 11), triggered by a T000190 Tilt Sensor attached to I0 (analog pin ...")
 
(Introduction)
 
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<syntaxhighlight lang="c">
+
==Introduction==
/*
+
The Linker Tilt Module is the equivalent of a button, and is used as a digital input. Inside the tilt switch is a pair of balls that make contact with the pins when the case is upright. Tilt the case over and the balls don't touch, thus not making a connection. It is wired to the SIG line, NC is not used on this kit.
Tilt
+
 
 +
[[File:Tilt 118101004 first.jpg| 500px]]
 +
 
 +
[[File:Tilt 118101004 second.jpg| 500px]]
  
Turns on and off a T010111 LED Module connected to O0 (digital 
+
[[File:Tilt 118101004 third.jpg| 500px]]
pin 11), triggered by a T000190 Tilt Sensor attached to I0 (analog pin 0).
 
  
created 2005
+
== Features ==
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.
+
Dimensions: 27.9×25.4×10.6mm
  
*/
+
Net weight: 3.6g
  
#define O0 11
+
== Dimension ==
#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
+
[[File:tilt dimension.jpg]]
// set pin numbers:
 
const int tiltPin = I0;    // the number of the Tilt Sensor pin
 
const int ledPin =  O0;      // the number of the LED pin
 
  
// variables will change:
+
== Schematics ==
int tiltState = 0;        // variable for reading the tilt Sensor status
+
*[https://s3.amazonaws.com/linksprite/LinkerKit/Linker+Tilt.pdf Schematics]
  
void setup() {
+
==Application Ideas==
  // initialize the LED pin as an output:
 
  pinMode(ledPin, OUTPUT);     
 
  // initialize the tilt Sensor  pin as an input:
 
  pinMode(tiltPin, INPUT);   
 
}
 
  
void loop(){
+
<syntaxhighlight lang="c">
  // read the state of the tilt Sensor  value:
 
  tiltState = digitalRead(tiltPin);
 
  
  // check if the tilt Sensor  is tilted.
+
int ledPin = 13;
  // if it is, the buttonState is HIGH:
+
int switchPin = 7;
  if (tiltState == HIGH) {    
+
int val = 0;
    // turn LED on:   
+
void setup()
    digitalWrite(ledPin, HIGH);
+
{
  }
+
  pinMode(ledPin,OUTPUT);
   else {
+
   pinMode(switchPin,INPUT);
    // turn LED off:
 
    digitalWrite(ledPin, LOW);  
 
  }
 
 
}
 
}
 +
void loop()
 +
{
 +
  //digitlRead(switchPin,HIGH)
 +
  val = digitalRead(switchPin);
 +
  if (HIGH == val)  digitalWrite(ledPin,HIGH);
 +
  else  digitalWrite(ledPin,LOW);
 +
}
 +
  
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
[[File:Tilt link.jpg]]
 +
 +
==How to buy==
 +
Here to buy Tilt Module on [http://store.linksprite.com/tilt-module-of-linker-kit-for-pcduino-arduino/ store]

Latest revision as of 08:17, 14 September 2016

Introduction

The Linker Tilt Module is the equivalent of a button, and is used as a digital input. Inside the tilt switch is a pair of balls that make contact with the pins when the case is upright. Tilt the case over and the balls don't touch, thus not making a connection. It is wired to the SIG line, NC is not used on this kit.

Tilt 118101004 first.jpg

Tilt 118101004 second.jpg

Tilt 118101004 third.jpg

Features

Dimensions: 27.9×25.4×10.6mm

Net weight: 3.6g

Dimension

Tilt dimension.jpg

Schematics

Application Ideas

<syntaxhighlight lang="c">

int ledPin = 13; int switchPin = 7; int val = 0; void setup() {

 pinMode(ledPin,OUTPUT);
 pinMode(switchPin,INPUT);

} void loop() {

 //digitlRead(switchPin,HIGH)
 val = digitalRead(switchPin);
 if (HIGH == val)  digitalWrite(ledPin,HIGH);
 else  digitalWrite(ledPin,LOW);

}


</syntaxhighlight>

Tilt link.jpg

How to buy

Here to buy Tilt Module on store