Public Member Functions | |
def | __init__ |
def | cancel |
Public Attributes | |
bit_timeout | |
bits | |
callback | |
cb_0 | |
cb_1 | |
code_timeout | |
gpio_0 | |
gpio_1 | |
in_code | |
num | |
pi | |
Private Member Functions | |
def | _cb |
A class to read Wiegand codes of an arbitrary length. The code length and value are returned. EXAMPLE #!/usr/bin/env python import time import pigpio import wiegand def callback(bits, code): print("bits={} code={}".format(bits, code)) pi = pigpio.pi() w = wiegand.decoder(pi, 14, 15, callback) time.sleep(300) w.cancel() pi.stop()
Definition at line 5 of file wiegand.py.
def wiegand.decoder.__init__ | ( | self, | |
pi, | |||
gpio_0, | |||
gpio_1, | |||
callback, | |||
bit_timeout = 5 |
|||
) |
Instantiate with the pi, gpio for 0 (green wire), the gpio for 1 (white wire), the callback function, and the bit timeout in milliseconds which indicates the end of a code. The callback is passed the code length in bits and the value.
Definition at line 36 of file wiegand.py.
def wiegand.decoder._cb | ( | self, | |
gpio, | |||
level, | |||
tick | |||
) | [private] |
Accumulate bits until both gpios 0 and 1 timeout.
Definition at line 65 of file wiegand.py.
def wiegand.decoder.cancel | ( | self | ) |
Cancel the Wiegand decoder.
Definition at line 106 of file wiegand.py.
Definition at line 42 of file wiegand.py.
Definition at line 67 of file wiegand.py.
Definition at line 42 of file wiegand.py.
Definition at line 42 of file wiegand.py.
Definition at line 42 of file wiegand.py.
Definition at line 67 of file wiegand.py.
Definition at line 42 of file wiegand.py.
Definition at line 42 of file wiegand.py.
Definition at line 42 of file wiegand.py.
Definition at line 67 of file wiegand.py.
Definition at line 42 of file wiegand.py.