Hi ,
I have problem in the code logic ,i did not find any solution.please give some suggestions.
my doubt is im using two IR sensor interface with arduino ,so when car is passing 1st sensor and 2nd sensor then i'm sending the data that car is passed ,that is fine but when ever car1 is passing 1st sensor and another car say ,car2 is in 2nd sensor than also flag is becoming 1 ,that is true but i dont want that.
how to code?, so that car should pass two sensors ,if car 1 is in sensor 1 and car 2 is in sensor 2 than flag should not be 1 .i hope u understand the problem.
Forget about the sensors for now. How would two people do it if they were placed in the same positions as the sensors and could only see the same area as the sensors ?
Would they communicate with one another when a car arrived at the sensor ?
Would they communicate with one another when a car left the sensor ?
Would they note the time that a car arrived at the sensor position ?
Would they time how long the car could be seen at each sensor ?
manisrinivas:
if i use only one sensor,any human passes to that can detect that sensor.so , i'm using two sensors for car parking system.
I think that you have missed the point of what I am asking.
Imagine that there are no sensors but there is a person sitting in the 2 places where they would be. Each of the two people are looking in the same direction as the sensors would be and can recognise whether there is currently a car in front of them or not. The two people can tell a third person what they can see.
Remember that they can only say
"I have just seen a car move into range"
"I have just seen a car move out of range"
"There is a car currently in range"
and
"There is no car currently in range"
With these pieces of information and/or combinations of them from the two people, how can the third person make the system work ?