Hi All, I want to make my first arduino project. This is the description about the project:
-Using two IR sensor to detect the dripping water in two different pipe.
-count number of dripping water in 30 seconds and shows them in different label in Microsoft Visual Studio.
-Using Serial communication to send and receive data from arduino to Computer.
This is my code for only one IR sensor and its works:
int sensorread = A0;
int counter = 0;
int milisecond = 0;
int second = 0;
int laststate = HIGH;
// put your setup code here, to run once:
// put your main code here, to run repeatedly:
state = digitalRead(sensorread);
if (state == LOW && laststate == HIGH)
if (milisecond == 1000)
milisecond = 0;
if (second == 1000)
second = 0;
counter = 0;
when I doubled it, it can work properly. Can anybody help me to built the arduino code for my project?
Many thanks thanks in help to resolved this program