
Basic example showing how to use an m3pi with the RFID Reader attached
Dependencies: mbed m3pi ID12RFIDIRQ
Diff: main.cpp
- Revision:
- 0:9ec7501efec2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Mar 19 09:22:14 2012 +0000 @@ -0,0 +1,30 @@ +// m3pi RFID Reader Example + +#include "mbed.h" +#include "m3pi.h" // m3pi robot controls +#include "ID12RFID.h" // RFID reader library + +m3pi m3pi; + +// This is needed to access the RFID Reader... +ID12RFID rfid(p14); + +int main() { + + m3pi.locate(0,0); + m3pi.printf("RFIDRead"); + + while (1) { + + // Check if the reader is reading an ID? + if(rfid.readable()) { + + // Get the ID from the reader... + int id = rfid.read(); + + // Print it on the LCD... + m3pi.locate(0,1); + m3pi.printf("%d", id); + } + } +}