arduino12 / rdm6300

A simple library to interface with RDM6300 RFID reader.
GNU General Public License v3.0
92 stars 32 forks source link

Add custom Stream support #7

Closed gutierrezps closed 5 years ago

gutierrezps commented 5 years ago

Following issue #6 here's a fix I've come up with, with minimal changes to the library.

I added a method begin() that takes a Stream object as a parameter, and the matching minimal working example, altsoftserial.ino. Here's an excerpt:

#include <AltSoftSerial.h>
#include <rdm6300.h>

AltSoftSerial rfidSerial;
Rdm6300 rdm6300;

void setup() {
    Serial.begin(115200);

    rfidSerial.begin(RDM6300_BAUDRATE);
    rdm6300.begin(&rfidSerial);
}
...
arduino12 commented 5 years ago

I have just pushed my fix and saw this PR, Great minds think alike....