Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Wiegand.h>
- WIEGAND wg1;
- WIEGAND wg2;
- byte flag = 0;
- void setup() {
- Serial.begin(115200);
- // default Wiegand Pin 2 and Pin 3 see image on README.md
- // for non UNO board, use wg.begin(pinD0, pinD1) where pinD0 and pinD1
- // are the pins connected to D0 and D1 of wiegand reader respectively.
- wg1.begin(32, 12);
- wg1.begin(27, 13);
- }
- void loop() {
- if (wg1.available())
- {
- flag = 1;
- Serial.print("Wiegand HEX = ");
- Serial.print(wg1.getCode(), HEX);
- Serial.print(", DECIMAL = ");
- Serial.print(wg1.getCode());
- Serial.print(", Type W");
- Serial.println(wg1.getWiegandType());
- }
- if (wg2.available())
- {
- flag = 2;
- Serial.print("Wiegand HEX = ");
- Serial.print(wg2.getCode(), HEX);
- Serial.print(", DECIMAL = ");
- Serial.print(wg2.getCode());
- Serial.print(", Type W");
- Serial.println(wg2.getWiegandType());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement