• Sourcing Solutions
  • Services & Membership
  • Help & Community
Tilt switch module for arduino

Tilt switch module for arduino

Shared by: Julia Lane from amazon
Share
Over 10 suppliers can give you a quotation.
Get Quotations Now
You should get the quotation(s) in 6 hours .
Description
Tilt switch module and digital 13 interface with LED to build a simple circuit, the production of tilt tips Using the digital 13 interface LED, will tilt switch sensor access digital 3 interface, when the tilt switch sensor sensing to have the key signal, LED light, and vice versa. Li Chengyuan Code: Int Led=13; / / LED interface definition Int buttonpin=3; / / define tilt switch sensor interface Int Val; / / define digital variable val Setup void () { PinMode (Led, OUTPUT); / / LED was defined as the output interface PinMode (buttonpin, INPUT); / / define tilt switch sensor output interface } Loop void () { Val=digitalRead (buttonpin); / / digital interface 3 the value read is assigned to val If (val==HIGH) / / when the tilt switch sensor signal, LED flashing { DigitalWrite (Led, HIGH); } Else { DigitalWrite (Led, LOW);

Notice:The articles, pictures, news, opinions, videos, or information posted on this webpage (excluding all intellectual properties owned by Alibaba Group in this webpage) are uploaded by registered members of Alibaba. If you are suspect of any unauthorized use of your intellectual property rights on this webpage, please report it to us at the following:ali-guide@service.alibaba.com.

ensearchweb033003028255