PropWare
C++ objects and CMake build system for Parallax Propeller
Home
Download
Getting Started
Documentation
Reference
About
Related Links
Namespace List
Class List
File List
Examples
Build System
File List
File Members
propsideworkspace
Learn
Examples
Devices
Sensor
RFID Serial
RFID Read.c
1
/*
2
RFID Read.c
3
4
Reads and displays RFID tag numbers.
5
6
Connect: Vcc to 5V, /ENABLE to P2, SOUT to (R = 2.2 k) to P1, GND to GND
7
8
http://www.parallax.com/product/28140
9
*/
10
11
#include "simpletools.h"
// Include simpletools
12
#include "rfidser.h"
// Include rfidser
13
14
int
rfidEn = 2;
// Reader /ENABLE pin to P2
15
int
rfidSout = 1;
// Reader SOUT pin to P1
16
17
rfidser *rfid;
// Set up device ID
18
19
int
main
()
// Main function
20
{
21
rfid = rfid_open(rfidSout, rfidEn);
// Open reader, start reading
22
23
while
(1)
// Main loop
24
{
25
char
*str = rfid_get(rfid, 1000);
// Wait up to 1 s for card
26
print(
"id = %s.\n"
, str);
// Print ID.
27
}
28
}
main
int main(void)
Definition:
GraphicsTest.c:20
Generated on Sat Aug 27 2016 00:58:03 for PropWare by
1.8.12