Forums

Count pulses

Started by eurolcdx April 20, 2010
I'm a newbie to BasicX and programming in general.

Has anyone got some guidance (sample code) on how to count slow pulses (from a Hall Effect Sensor). Pulse rate is around 1 pulse per second.

Apart from the info found on the Netmedia BasicX web site, are there any other reference sites that could be helpful?

Here goes my piece of code used to count time between 2 consecutive
pulses... Hope it helps

Public Wind_Speed as integer ' Tem que ser public para
que a task_Wind fct

do
WaitforInterrupt(bxPinRisingEdge)
Tempo_i=timer() 'initial time
WaitforInterrupt(bxPinRisingEdge)
Tempo_f=timer()
Dtempo= tempo_f-tempo_i
call delay (0.8)
loop