# micropython-wiegand **Repository Path**: scpro/micropython-wiegand ## Basic Information - **Project Name**: micropython-wiegand - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-01-13 - **Last Updated**: 2022-01-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 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](https://en.wikipedia.org/wiki/Wiegand_interface) reader. ## Example usage: ```python 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) ```