it is not clear to me what happens when new event is(should be) detected by add_event_detect() before the callback function from previous event is finished? I expect quite high frequency of input impulses (1kHz). I want to count impulses in time intervals.
I guess the same problem can be with Python GPIO, pigpio library or in C with equivalent libraries.
Code: Select all
def increaseCounter(channel):
global counter
counter = counter +1
# something more to do ...
GPIO.add_event_detect(channel, GPIO.RISING, callback=increaseCounter)
while True:
sleep(interval)
# Read counter and add time of reading ...