Revpi compact unreg method
Posted: 13 Jun 2024, 14:44
Hello,
I've got a Revpi compact.
On my system, I've got to count some events on a digital input.
for that, I've used reg_event() method. After a count of 10, I want to unregister this event.
Here is the "reg_event" code:
def fan_event_start(self):
global fan_time
fan_time = time.time()
self.rpi.io.DInBit_1.reg_event(self.fan_event, edge=revpimodio2.RISING)
self.rpi.mainloop()
And the "unreg_event":
def fan_event_stop(self):
self.rpi.io.DInbit_1.unreg_event(self.fan_event)
But it raise me :
raise AttributeError("can not find io '{0}'".format(key))
AttributeError: can not find io 'DInbit_1'
I don't understand my error, could someone explain me ?
Thanks
Franck
I've got a Revpi compact.
On my system, I've got to count some events on a digital input.
for that, I've used reg_event() method. After a count of 10, I want to unregister this event.
Here is the "reg_event" code:
def fan_event_start(self):
global fan_time
fan_time = time.time()
self.rpi.io.DInBit_1.reg_event(self.fan_event, edge=revpimodio2.RISING)
self.rpi.mainloop()
And the "unreg_event":
def fan_event_stop(self):
self.rpi.io.DInbit_1.unreg_event(self.fan_event)
But it raise me :
raise AttributeError("can not find io '{0}'".format(key))
AttributeError: can not find io 'DInbit_1'
I don't understand my error, could someone explain me ?
Thanks
Franck