jpliew / Multi-Reader-Wiegand-Protocol-Library-for-Arduino

Multi Reader Wiegand Protocol Library for Arduino
18 stars 3 forks source link

Could not write or read over Serial port #7

Open francescochiapello opened 6 months ago

francescochiapello commented 6 months ago

Hi @jpliew, I'm not able to read or write data while using the library through the serial port with baud 9600. Do you have any suggestion on how to handle this problem? It's necessary to me to exchange text data between Arduino and my external code alongside the library execution that reads Wiegand data.

Thanks for your support.

// ...

void setup() {
  Serial.begin(9600);
  wg1.begin(1,2,Reader1D0Interrupt,Reader1D1Interrupt);
}

void loop() {
  if (Serial.available() > 0) {
    String command = Serial.readString();

    Serial.println(command);
  }

  if(wg1.available())
  {
    Serial.println(wg1.getCode());
  }
}
jpliew commented 6 months ago

This library does not hold on to the Serial internally.

If you are using UNO, you are using PIN 1 for the Wiegand, and it is conflicting with the Serial of Arduino UNO