Hi all, I'm working on a Weigand to ASCII converter to replace some deprecated hardware but I'm experiencing trying to get the Wiegand device to communicate with the Arduino. My project tools are as follows:
- Arduino Uno R3
- Schlage Handkey II
- Wiegand Protocol Library for Arduino
- MacBook Pro OS X 10.10
- Arduino IDE 1.5.8 Beta
I have everything connected correctly, my code compiles, and the code is uploaded to the Arduino just fine but I get no output when using the following code:
#include <Wiegand.h>
WIEGAND wg;
void setup() {
Serial.begin(9600);
wg.begin();
}
void loop() {
if(wg.available()) {
Serial.print("Wiegand HEX = ");
Serial.print(wg.getCode(),HEX);
Serial.print(", DECIMAL = ");
Serial.print(wg.getCode());
Serial.print(", Type W");
Serial.println(wg.getWiegandType());
}
}
I verified a few things before I turned to this forum:
- Serial monitor prints data if I do something like void setup() { Serial.println("Foo"); }
- Wiegand device works
- Everything is plugged in
I'm aware the wg.available() method fails which is causing the information inside to not print. Normally, I would step through the program using a debugger to see where it actually fails but I have no idea how to do this or if it's even possible in this environment.
Does the problem lie with my wiring? How do I know the Arduino is actually receiving any signal?
I'm terribly new to the Arduino world so I apologize in advance for my noob questions.