Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pjz/micropython-wiegand
A Wiegand protocol library for micropython
https://github.com/pjz/micropython-wiegand
Last synced: 6 days ago
JSON representation
A Wiegand protocol library for micropython
- Host: GitHub
- URL: https://github.com/pjz/micropython-wiegand
- Owner: pjz
- Created: 2016-12-30T19:43:32.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-10-27T06:45:07.000Z (about 2 years ago)
- Last Synced: 2024-04-29T11:33:32.264Z (6 months ago)
- Language: Python
- Size: 7.81 KB
- Stars: 27
- Watchers: 5
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
- awesome-mpython - micropython-wiegand - Wiegand protocol reader. (精选驱动库 / 通讯类)
- awesome-micropython - micropython-wiegand - Wiegand protocol reader. (Libraries / Communications)
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 heredef 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)
```