Wet & Dry Waste Smart Dustbin for House | Best science Project | Harish Projects

....Watch Full Detailed video....
//Arduino code//
/*
1. If an object is detected, turn the
servo motor 10 degrees
2. If there is no object detected,
turn the servo motor 150 degrees
*/
#include <Servo.h>
Servo Serv;
int pinIR=3;
int pinServo=5;
int val=0;
void setup(){
Serv.attach(pinServo);
}
void loop(){
val = digitalRead(pinIR);
if (val ==0){
Serv.write(95);
delay(100);
}
else
{
Serv.write(10);
delay(100);
}
}
//You can order Project kit from us.
Contact:-
WP - 8602221288
Instagram - https://www.instagram.com/harishchoudhary70/reels/?hl=en
Comments