Tilt SW-520D Sensor (SW-520D) [S067]



https://www.youtube.com/watch?v=AbBB5RE9uQs


*GitHubhttps://github.com/rdiot/rdiot-s067.git


* Specs

Max voltage : 20V 

Max current : 0.3A


* Contents

- Connect

1 ---- 5V

2 ----- R220 ----- D2

           ------ GND


- Key Code

int pin = 2;

int val = digitalRead(pin);


if(val == LOW)

  lcd.setCursor(0,2);

  lcd.print("Tilt CLOSE");

}

else

{

  lcd.setCursor(0,2);

  lcd.print("Tilt OPEN ");  

}

Posted by RD IoT RDIoT

댓글을 달아 주세요