LCD display, Teraterm display
Dependencies: ID12RFID ID12RFID_HelloWorld TextLCD mbed
Fork of ID12RFID_HelloWorld by
Diff: main.cpp
- Revision:
- 2:53965de58fda
- Parent:
- 1:2c017f3d2d04
- Child:
- 3:61e6bd867047
--- a/main.cpp Tue Nov 23 17:17:56 2010 +0000 +++ b/main.cpp Sat May 09 09:29:16 2015 +0000 @@ -1,15 +1,45 @@ -// Hello World for printing RFID tag numbers +// Program for reading and matching RFID tags #include "mbed.h" -#include "ID12RFID.h" +#include "TextLCD.h" + +Serial rx(NC, PTA1); // uart rx +Serial pc(USBTX, USBRX); +TextLCD lcd(PTA13, PTD5, PTD0, PTD1, PTD2, PTD3, TextLCD::LCD16x2); // RS, E, D4-D7 + -ID12RFID rfid(p14); // uart rx +int count = 0; +int input[12]; +bool flag = 0; + +int main() +{ + pc.printf("Welcome to RFID Access\n"); + lcd.locate(0,0); + lcd.printf("RF ID:"); + + rx.baud(9600); -int main() { - printf("Hello World\n"); - while(1) { - if(rfid.readable()) { - printf("RFID Tag number : %d\n", rfid.read()); + while(1) + { + /* if (rx.readable()) + { + pc.printf("%02x\n", rx.getc()); + } + */ + + if(rx.readable()) + { + count = 0; + while(rx.readable() && count < 12) + { + input[count] = rx.getc(); + pc.printf("%d %c\n", count, input[count]); + lcd.locate(count,1); + lcd.putc(input[count]); + count++; + } } } + }