Home

Grove - Tilt Switch User Manual

image

Contents

1. y seeed Grow the Difference Grove Tilt Switch User Manual Release date 2015 9 22 Version 1 0 Wiki http www seeedstudio com wiki Grove Tilt Switch Bazaar http www seeedstudio com depot Grove Tilt Switch p 771 html cPath 25 6 y seeed Grow the Difference Document Revision History y seeed Grow the Difference Contents Document Revision History EE AE EE EE ET EE EE EE 1 Introduction EERS SEER Re ER ee EER EER GE EE Ke Re Re Re ee ee GE Re ee ee GE EE Ke ee GR EE Ee ee ee ee ee 2 Feature TT Tr ere ree RE CE Tee ee rr ee ee EE ee 3 Tie SO EE EE 4 Usage 41 With GE AE 5 Reference RR OE OE OR EE N OE EE E 5 1 EEN IE 6 Resource 7 y seeed Grow the Difference Disclaimer For physical injuries and possessions loss caused by those reasons which are not related to product quality such as operating without following manual guide natural disasters or force majeure we take no responsibility for that Under the supervision of Seeed Technology Inc this manual has been compiled and published which covered the latest product description and specification The content of this manual is subject to change without notice Copyright The design of this product including software and its accessories is under tutelage of laws Any action to violate relevant right of our product will be penalized through law Please consciously observe relevant local laws in the use of this product
2. y seeed Grow the Difference 1 Introduction The Grove 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 It is wired to the SIG line NC is not used on this Grove y seeed Grow the Difference 2 Feature Grove Interface Easy to use 6 Simple Grove module Grow the Difference y seeed 3 Specification Item Min Typical Max Unix Voltage 4 75 5 0 5 25 V Connecting Angle 10 170 Degree Disconnect Angle 190 350 Degree Electrical Life 100 000 Cycle y seeed Grow the Difference 4 Usage 4 1 With Arduino The SIG pin of the Grove Tilt Switch output LOW normally When the Tilt Switch is upright a pair of balls inside the tilt switch will contact with the pins and the SIG pin will output HIGH The following sketch demonstrates a simple application of using the Tilt Switch and Grove Button to control the led 6 As the following picture indicates the Tilt Switch is connected to digital port 5 of the Grove Basic Shield and the Grove Button to digital port 7 The LED is connected to digital port 2 The hardware installation is as follows Copy and paste code below to a new Arduino sketch void setup pinMode 1 OUTPUT pinMode 5 INPUT pinMode 7
3. INPUT void loop if digitalRead 5 HIGH digitalWrite 1 HIGH delay 100 digitalWrite 1 LOW y seeed Grow the Difference if digitalRead 7 HIGH digitalWrite 1 HIGH delay 200 digitalWrite 1 LOW 6 Upload the code please click here if you do not know how to upload Then the LED will light when you press the button or activate the tilt switch Have a try y seeed Grow the Difference 5 Reference The Operate angle of Grove Tilt Switch as shown below Operating Range Cross Section A 0 1 y Allow 500ms settling time between states Note The logo J1 in the Grove is as reference terminal 5 1 With Raspberry Pi 1 You should have got a raspberry pi and a grovepi or grovepi 2 You should have completed configuring the development enviroment otherwise follow here 3 Connection 6 Plug Tilt_Switch into grovepi socket D3 by using a grove cable 4 Navigate to the demos directory cd yourpath GrovePi Software Python 6 To see the code nano grovepi tilt switch py Ctrl x to exit 8 import time import grovepi Connect the Grove Tilt Switch to digital port D3 SIG NC VCC GND tilt_switch 3 grovepi pinMode tilt switch INPUT while True print grovepi digitalRead tilt switch y seeed Grow the Difference time sleep 5 except IOError print Error 5
4. Run the demo sudo python grove tilt switch py 6 Result Put the sensor upright by one side the SIG pin will output HIGH Wy pi raspberrypi Desktop GrovePi Software Python 0 E raspberrypi Desktop GrovePi Software Python sudo python grove_tilt_switch py MO 0 0 0 0 y seeed Grow the Difference 6 Resource 6 Grove Tilt Switch v1 0 Eagle File e Grove Tilt Switch v1 1 PDF File 6 Grove Tilt Switch v1 1 Eagle File 6 SW200D datasheet

Download Pdf Manuals

image

Related Search

Related Contents

Manuale Montaggio  1 con éxito se realizó la quinta jornada de capacitación, organizada    Formative Writing Assessment User Manual  Sony DVP-NS500V User's Manual    

Copyright © All rights reserved.
Failed to retrieve file