I'm trying to read pulses from coin acceptor (sensor) and depending on the pulses, different solenoids should work.
here, in the sensor I can program the sensor to give pulses as i want
for example for p1 coin i can set it to give 5 pulses and for p2 coin i can set it to give 10 pulses.
So I've programmed it to give
2 pulses for P1 coin
5 pulses for p2 coin
10 pulses for p3 coin
now the sensor gives pulse output which should be read in the arduino and if 5 pulses are detected it should activate a solenoid and if 10 pulses are detected it should activate another solenoid. In this solenoid should push (high) and a delay then LOW should be given.
I don't have any idea what polling is, but i do know it should work on ISR as i've seen in some coin acceptor projects.
here, arduino should first detect all the pulses then activate the solenoid because if it accepts the pulses as they come it'll be a problem because when 5 pulses come arduino might directly jump into 2 pulses loop and activate different solenoid. please help