Description
So i created a fairly simple python program counting pulses using interrupts and i tested it on the bench with a single input for a couple of days and everything seemed to work well, when i started to use it for real i had 5 inputs and the pulse frequency was a bit higher, after around 22 hours the counting would stop. When i looked into why it could see that Python3 memory use was going up and up everytime a pulse was counted. The first thing i did was to create a test program that only counted and the problem persists with the pi eventually giving the error Cannot Allocate Memory - my test code is here;
def testcount(event):
global Count1
Count1 += 1
print(Count1)
Setup the Digital IO to watch for Rising Edge only
pifacedigital = pifacedigitalio.PiFaceDigital()
listener = pifacedigitalio.InputEventListener(chip=pifacedigital)
listener.register(0, pifacedigitalio.IODIR_RISING_EDGE, testcount)
listener.activate()
Here is a screen shot of the pi back on the bench showing the memory use rising. it only rises when a pulse is received