Open AuspeXeu opened 3 years ago
This will not work as the library was not written to cater for multiple wiegand. I will put this in a feature request and work on it when free.
C++ is not my daily driver so I am not super aware of how it works but what changes would be necessary for this to work? It's not like in OOP and another Wiegand
object is instantiated and that's it?
There are two things that needed to be done.
1) Move all the variables into proper C++ class
2) When I first wrote this, it was meant for UNO, and UNO has only two interrupts. In order to support multiple interrupts, we need to use pin change interrupts.
I just looked into the code it appears to me that it's already a C++ class, no?
I can confirm my code from the first post in this issue works with two readers connected to an Arduino Mega.
Because the variables were designed for only 1 reader in the global, it will not completely work for 2 readers. In your case it worked because you swiped the cards one by one.
I am going to leave this issue open so that others can see and also I try to allocate time to work on this.
The other thing, I am not sure how it worked on your test when you were using pin10 and pin11 for the second reader. Pin10 & 11 are not interrupt supported.
Fixed the code. I actually used different pins.
Try scan two readers at the same time, you will get wrong values.
I can confirm that yes.
@jpliew did you have a chance to look into this? :)
@AuspeXeu sorry for the slow reply. I was stuck with work commitments. Please take a look at this and see if you can get it working
https://github.com/jpliew/Multi-Reader-Wiegand-Protocol-Library-for-Arduino
I'll give it a shot an report back :)
Works like a charm :)
Was just wondering whether it would be possible to monitor two readers with the same controller. I tried the following code but it only logs reads from
Wiegand1
.