KY-017 |
Part Number | KY-017 |
Manufacturer | Joy-IT |
Description | ..... 1 3 Pinout ...... |
Features |
16.06.2017
Copyright by Joy-IT - Published under CC BY-NC-SA 3.0
Page 71 of 214
KY-017 Tilt switch module
Pinout
Code example Arduino
This example will light up a LED as soon as the tilt module is in the right angle. The modules KY-011, KY-016 or KY-029 can be used as LED.
int Led = 13 ;// Declaration of the LED output pin int Sensor = 10; // Declaration of the sensor input pin int val; // temporary variable void setup () {
pinMode (Led, OUTPUT) ; // Initialization output pin pinMode (Sensor, INPUT) ; // Initialization sensor pin } void loop () { val = digitalRead (Sensor) ; // The active... |
Document |
KY-017 Data Sheet
PDF 359.11KB |
Distributor | Stock | Price | Buy |
---|