Sharad is very fond of gardening. He has got some plants in the office too. Once Jugaadu went to visit him in the office. Sharad told Jugaadu that his plants are dying as he is not able to water them timely while he is on a business trip. He asks help from Jugaadu to save his plants?br
Bag Items:
"
int pumpp=7;
int pumpn=6;
void setup() {
// put your setup code here, to run once:
pinMode(pumpp,OUTPUT);
pinMode(pumpn,OUTPUT);
pinMode(5,OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
analogWrite(5,140);
if(analogRead(A0)<170){
digitalWrite(pumpp,LOW);
digitalWrite(pumpn,LOW);
}else{
digitalWrite(pumpp,HIGH);
digitalWrite(pumpn,LOW);
}
Serial.println(analogRead(A0));
}