Skip to content
A Wiegand protocol library for micropython
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
Makefile
README
README.md
setup.py
wiegand.py

README.md

Wiegand protocol reader for micropython

This library is essentially the Wiegand class, which allows the user to set callbacks based on receiving a card number from a wiegand-protocol reader.

Example usage:

    from wiegand import Wiegand
    VALID_FACILITY_CODES = [ '123']
    VALID_CARDS = [ '12345' ]

    GREEN_LED = Pin(...)
    RED_LED = Pin(...)

    WIEGAND_ZERO = XX  # Pin number here
    WIEGAND_ONE = YY   # Pin number here

    def on_card(card_number, facility_code, cards_read):
	if (card_number in VALID_CARDS) and (facility_code in VALID_FACILITY_CODES):
	    GREEN_LED.high()
	    RED_LED.low()
	else:
	    RED_LED.high()
	    GREEN_LED.low()
    
    
    Wiegand(WIEGAND_ZERO, WIEGAND_ONE, on_card)
You can’t perform that action at this time.