monkeyboard / Wiegand-Protocol-Library-for-Arduino

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

Update WiegandTest.ino added proper pin definitions for Leonardo #30

Closed Netoperz closed 6 years ago

Netoperz commented 6 years ago

new IDE compatibility, and pin definitions in init, , now works on Leonardo, and also on ESP

jpliew commented 6 years ago

There is nothing wrong with the original code

In README.md

void setup() {
    Serial.begin(9600);  
    wg.begin(); // wg.begin(pinD0, pinD1) for ESP8266/ESP32
}

It is clear that user can use another declaration.

Netoperz commented 6 years ago

Iknow, but for dummies the example should be consistent with the wiki page, and on those graphics you clearly show pins 2 and 3 to connect to arduino, so logically the code should out of the box correspond to the manual. without re-thinking how to declare and where and what.. "puff" and works :)

That's why I think there should be declaration in example for those pins.

jpliew commented 6 years ago

The requirement on the README page clearly showed that

Arduino - Any ATMEGA328 compatible board should work.

Leonardo is not ATMEGA328.

Moreover, the graphics clearly showed it was an Arduino UNO not Aduino Leonardo.

Netoperz commented 6 years ago

On uno same problem. and resolved same way by declaring the pins. I just point to logical interpretation that using something is more straightforward when it is ready to use out of the box (that's my job, doing things that do not exist or already exist but in a way that is more straightforward and more "transparent" for the user), Just want to help that's all, and testing stuff always helps :)

jpliew commented 6 years ago

@Netoperz there were some changes in how Arduino uses attachInterrupt that affects the wg.begin(), I am already working on this. wg.begin(2,3) is just another way to call the init, but not the solution to the problem.

Please focus working on the WiegandNG separate issue and report back, thanks.

Netoperz commented 6 years ago

Ok mate :) I'm testing now the code you asked to test.