Hello Everyone
I am using OMRON Photo Interrupter to calculate the number of drops from a dropper.
I am using the following code:
int val = 0; // variable to store the value coming from the sensor
void setup()
{
Serial.begin(9600); // set up Serial library at 9600 bps
}
void loop()
{
val = analogRead(A0); // read the value from the sensor
Serial.println(val); // print the sensor value to the serial monitor
delay(5000);
}
I want that when one drop passes from the Photo Interrupter, '1' should be sent to the serial monitor and '0' if otherwise. I am just having analog values which do not change when drop passes.
Can anyone help me in achieving my desired result?
Thank you all in advance.
Best Regards,
Rushan