Skip to content

Commit 0c56df2

Browse files
committed
Add hardware_uart example
1 parent 6e4028c commit 0c56df2

File tree

4 files changed

+46
-4
lines changed

4 files changed

+46
-4
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* A simple example to interface with rdm6300 rfid reader using
3+
* hardware uart "Serial" instead of the default software uart driver.
4+
*
5+
* Will only compile for boards with Serial1 or more:
6+
* https://www.arduino.cc/reference/en/language/functions/communication/serial/
7+
*
8+
* Arad Eizen (https://github.com/arduino12).
9+
*/
10+
11+
#include <rdm6300.h>
12+
13+
#define READ_LED_PIN 13
14+
15+
Rdm6300 rdm6300;
16+
17+
void setup()
18+
{
19+
Serial.begin(115200);
20+
21+
pinMode(READ_LED_PIN, OUTPUT);
22+
digitalWrite(READ_LED_PIN, LOW);
23+
24+
Serial1.begin(RDM6300_BAUDRATE); // read the doc above, find the RX pin number in the link
25+
rdm6300.begin(&Serial1);
26+
27+
Serial.println("\nPlace RFID tag near the rdm6300...");
28+
}
29+
30+
void loop()
31+
{
32+
/* if non-zero tag_id, update() returns true- a new tag is near! */
33+
if (rdm6300.update())
34+
Serial.println(rdm6300.get_tag_id(), HEX);
35+
36+
digitalWrite(READ_LED_PIN, rdm6300.is_tag_near());
37+
38+
delay(10);
39+
}

examples/read_to_serial/read_to_serial.ino

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33
*
44
* Connect the rdm6300 to VCC=5V, GND=GND, TX=any GPIO (this case GPIO-04)
55
* Note that the rdm6300's TX line is 3.3V level,
6-
* so it's save to use with both AVR* and ESP* microcontrollers.
6+
* so it's safe to use with both AVR* and ESP* microcontrollers.
7+
*
8+
* This example uses SoftwareSerial, please read its limitations here:
9+
* https://www.arduino.cc/en/Reference/softwareSerial
710
*
811
* Arad Eizen (https://github.com/arduino12).
912
*/
1013

1114
#include <rdm6300.h>
1215

13-
#define RDM6300_RX_PIN 4
16+
#define RDM6300_RX_PIN 4 // read the SoftwareSerial doc above! may need to change this pin to 10...
1417
#define READ_LED_PIN 13
1518

1619
Rdm6300 rdm6300;

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rdm6300",
3-
"version": "1.1.6",
3+
"version": "1.1.7",
44
"keywords": "rdm6300, rfid",
55
"description": "A simple library to interface with rdm6300 rfid reader.",
66
"repository":

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Rdm6300
2-
version=1.1.6
2+
version=1.1.7
33
author=Arad Eizen
44
maintainer=Arad Eizen <https://github.com/arduino12>
55
sentence=A simple library to interface with rdm6300 rfid reader.

0 commit comments

Comments
 (0)