If you use a 28X1, 40X1, 28X2 or 40X2 then you can use the external timer which runs in the background. If not, then you can manually implement counting.In a project I need to stop a pump when a fixed number of pulses from a flow sensor has been reached.
So I count the pulses in a subroutine during 1 second until NumberOfPulses > Value.
Problem is that during the rest of the program pulses are being lost.Code:CountPulses: count FlowSensor,100,NumberOfPulses PulseCounter = PulseCounter + NumberOfPulses return
It would be great if the COUNT command had an parameter that makes the command count until that number of pulses has been reached.
Code section for manual counting extracted from previous project:
Code:
check:if reed = 1 then
if reedstatus = 0 then
inc loopcounter
reedstatus = 1
end if
else
reedstatus = 0
end if
'put whatever code you want here
goto check
ADDED: If this is a follow-up to a previous thread say so so that members like me who may have not been following your work don't repeat suggestions that you decided was inappropriate.
EDIT: I've looked at your past posts and this does not appear to be a continuation but rather a Programming Editor suggestion. I'd think that not being able to terminate 'count' is a limitation of the PICAXE itself and not Programming Editor. I'd suggest using one of the two methods above.
Last edited: