Crowtail- Tilt Switch
Description¶
The Crowtail- Tilt Switch 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.
Model: CT0023TS
Festure¶
- Crowtail Interface
- Easy to use
Specification¶
Dimensions(mm):20.0(L)x20.0(W)x6.8(H)
Item | Min | Typical | Max | Unit |
---|---|---|---|---|
Voltage | 4.75 | 5.0 | 5.25 | V |
Connect angle | 10° ~170° | - | ||
Disconnect angle | 190° ~350° | - | ||
Electrical life | 100000 | cycles | ||
Usage¶
1.Hardware connection
2.Copy and paste code below to a new Arduino sketch.
void setup()
{
pinMode(4, INPUT); //connect to Crowtail- Tilt Switch
pinMode(5, OUTPUT);//connect to Crowtail- LED
}
void loop()
{
if (digitalRead(4)==HIGH)
{
digitalWrite(1, HIGH);
delay(100);
digitalWrite(5, HIGH);
}
else
{
digitalWrite(5, LOW);
}
}
3.Test result: