Mini Mercury Switch Module (KY-017) [S049]



https://www.youtube.com/watch?v=TzuxDa6xQ-g


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


* Specs

Working voltage: 3.3V~5V

digital switch output (0 & 1)

High sensitivity

With fixed bolt hole for easy installation

Works with Official Arduino Boards

Application: For Arduino DIY project

Forum link: https://www.facebook.com/123Neonado

Material PCB

Dimensions: 31 x 15 x 8 mm / 1.22 x 0.59 x 0.31 inch

Weight: 2 g / 0.07 oz

Color: Black


* Contents

- Connect

- ----- GND

middle ----- 5V

S ----- D2


- 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 RDIoT

댓글을 달아 주세요