TinkerKit Tilt Sensor module Ver más grande La imagen puede diferir del original

TinkerKit Tilt Sensor module

T000190

Nuevo

En Stock

3,90 €

El Tilt Sensor (Sensor de inclinación) se activa cuando detecta un ángulo de 180º respecto al eje horizontal.

Salidas: Este módulo lleva dos contactos y una pequeña bola metálica. Cuando el sensor se encuentra en la posición correcta, la bola metalica une los dos contactos, cerrando así el circuito. Cuando el sensor se inclina, la bola se mueve y el circuito se desconecta. En la posición correcta el modulo restituye 5V, mientras si se vuelca restituye 0V. Cuando se conecta a una entrada Arduino que utiliza el TinkerKit Shield, el valor correspondiente a la ubicación correcta será 1023, pero cuando se inclina restituye el valor 0

Descripción del Módulo: este módulo lleva un Tilt Sensor, el conectór TinkerKit de 3 pines, un amplificador de señal, un LED verde que indica si el módulo está alimentado correctamente y un LED amarillo que indica cuando se establece la conexion (el sensor está en posición vertical)

Este modulo es un SENSOR. El conector es un OUTPUT y tiene que ser conectado a los conectores INPUT del TinkerKit Shield.

 

ejemplo de codigo


/*
 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 0).

 created 2005
 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.

 */


 #define O0 11
 #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
// 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:
int tiltState = 0;         // variable for reading the tilt Sensor status

void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);      
  // initialize the tilt Sensor  pin as an input:
  pinMode(tiltPin, INPUT);    
}

void loop(){
  // read the state of the tilt Sensor  value:
  tiltState = digitalRead(tiltPin);

  // check if the tilt Sensor  is tilted.
  // if it is, the buttonState is HIGH:
  if (tiltState == HIGH) {    
    // turn LED on:    
    digitalWrite(ledPin, HIGH);  
  }
  else {
    // turn LED off:
    digitalWrite(ledPin, LOW);
  }