I need some help with my python-gpiozero combination.
I build an Script and installation to get the impulses of my gas meter "Pipersberg G4 RF1c"
I am using a proximity sensor to manage this. It works quite good, but there is ONE condition, everyhing collapses..:
My gas meters gives a impuls every 0,001 kbm of gas consumed. My sensor recognized this and print out a specified string. It works good, but if the gas meters "stucks" at the point the sensor get the impuls, the sensor stays active, so the Script is activated again and again and again as long as the gas meters continues..
Anyone has an idea how to catch this issue??
Code: Select all
from gpiozero import Button import datetime import time from time import sleep from time import sleep button = Button(4) while True: button.wait_for_press() datetime.datetime.now().strftime("%a, %d %B %Y %H:%M:%S") print(datetime.datetime.now()) sleep(2) print("The button was pressed!")
Thanks in advance, Regards
ps: sorry for possible bad english