Please advice the following, I’m going to make an automatic flush at the toilet. I’m going to use ultrasound sensor and 2 servo. My flush system has 2 buttons, one will put a small ammount of water, another - big, due to this I’m going to use 2 servos.
I will make a program which will measure the distance from the sensor to the my hand, if my hand will be in the distance between 3 to 5 cm for 3 seconds, then arduino will give the command to first servo, if my hand will be at the same distance for 5 seconds, then the command will go to another servo.
So i need to count the time, how many seconds my hand will be near the sensor.
I don’t have at mind how to do this.
Thanks in advance.