Go Down

Topic: Help with Wiegand to ASCII conversion (Read 943 times) previous topic - next topic

djthoms

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:



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:

Code: [Select]
#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.

PaulS

Quote
Everything is plugged in
Except that I don't see a ground connection.
The art of getting good answers lies in asking good questions.

DesertFoxNV

djthoms did you have any luck getting it to work? I am also trying to work on a Schlage Handkey II.

Go Up