monkeyboard / Wiegand-Protocol-Library-for-Arduino

Wiegand 26 and Wiegand 34 Protocol Library for Arduino
323 stars 131 forks source link

Is it possible to add onReceive like method? #22

Open nardev opened 6 years ago

nardev commented 6 years ago

Is it possible to add something like "onReceive" so that you can attach call back functions what to do with read...

IfollowU commented 6 years ago

Is it possible to use 2 instances i.e ( wg and wg2)? It is possible to use 2 instance as per tested with ESP8266, but randomly show IN or OUT at any reader swiped. They are separated when swiped.

codes:-

if (wg.available()) { String tagId = String(wg.getCode(), HEX); tagId.toUpperCase(); String data = sysId + "," + epoch + "," + tagId + "," + "IN"; //Serial.print(data); sendmsg(data);

} if (wg2.available()) { String tagId = String(wg2.getCode(), HEX); tagId.toUpperCase(); String data = sysId + "," + epoch + "," + tagId + "," + "OUT"; //Serial.print(data); sendmsg(data); }

IfollowU commented 6 years ago

Looks like there are latest version of the library, now able to differentiate IN and OUT. cCan detect gate 1, gate2 and gate 3. Thanks

https://github.com/ugge75/Wiegand-V3-Library-for-all-Arduino