Skip to product information
1 of 1

ZigBee 7W Pro COB SPOT LIGHT (cutout 60mm)(Black & White)

ZigBee 7W Pro COB SPOT LIGHT (cutout 60mm)(Black & White)

Regular price Rs. 200.00
Regular price Sale price Rs. 200.00
Sale Sold out
Shipping calculated at checkout.
Wattage

Servo door;int trig = 12;int echo = 11;int waterSensor = A0;int wetLimit = 10;void setup() {  door.attach(8);  pinMode(trig, OUTPUT);  pinMode(echo, INPUT);}void loop() {  // Ultrasonic trigger  digitalWrite(trig, LOW);   delayMicroseconds(5);  digitalWrite(trig, HIGH);   delayMicroseconds(10);  digitalWrite(trig, LOW);  long time = pulseIn(echo, HIGH);  int gap = time * 0.034 / 2;   // distance  if (gap < 15 && gap > 1) {    delay(100);    int wetValue = analogRead(waterSensor);    wetValue = constrain(wetValue, 485, 1023);    int wetPercent = map(wetValue, 485, 1023, 100, 0);    delay(100);    // Wet → right | Dry → left    if (wetPercent > wetLimit) {      delay(100);      door.write(170);   // wet side    } else {      delay(100);      door.write(10);    // dry side    }    delay(2000);    door.write(90);      // center again  }  delay(300);}

View full details