LCD display, Teraterm display

Dependencies:   ID12RFID ID12RFID_HelloWorld TextLCD mbed

Fork of ID12RFID_HelloWorld by Simon Ford

Committer:
nmoorthy2001
Date:
Sat May 09 09:29:16 2015 +0000
Revision:
2:53965de58fda
Parent:
1:2c017f3d2d04
Child:
3:61e6bd867047
Made changes to include 16x2 LCD display and display on teraterm.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nmoorthy2001 2:53965de58fda 1 // Program for reading and matching RFID tags
simon 0:df71eb8a3c0b 2
simon 0:df71eb8a3c0b 3 #include "mbed.h"
nmoorthy2001 2:53965de58fda 4 #include "TextLCD.h"
nmoorthy2001 2:53965de58fda 5
nmoorthy2001 2:53965de58fda 6 Serial rx(NC, PTA1); // uart rx
nmoorthy2001 2:53965de58fda 7 Serial pc(USBTX, USBRX);
nmoorthy2001 2:53965de58fda 8 TextLCD lcd(PTA13, PTD5, PTD0, PTD1, PTD2, PTD3, TextLCD::LCD16x2); // RS, E, D4-D7
nmoorthy2001 2:53965de58fda 9
simon 0:df71eb8a3c0b 10
nmoorthy2001 2:53965de58fda 11 int count = 0;
nmoorthy2001 2:53965de58fda 12 int input[12];
nmoorthy2001 2:53965de58fda 13 bool flag = 0;
nmoorthy2001 2:53965de58fda 14
nmoorthy2001 2:53965de58fda 15 int main()
nmoorthy2001 2:53965de58fda 16 {
nmoorthy2001 2:53965de58fda 17 pc.printf("Welcome to RFID Access\n");
nmoorthy2001 2:53965de58fda 18 lcd.locate(0,0);
nmoorthy2001 2:53965de58fda 19 lcd.printf("RF ID:");
nmoorthy2001 2:53965de58fda 20
nmoorthy2001 2:53965de58fda 21 rx.baud(9600);
simon 0:df71eb8a3c0b 22
nmoorthy2001 2:53965de58fda 23 while(1)
nmoorthy2001 2:53965de58fda 24 {
nmoorthy2001 2:53965de58fda 25 /* if (rx.readable())
nmoorthy2001 2:53965de58fda 26 {
nmoorthy2001 2:53965de58fda 27 pc.printf("%02x\n", rx.getc());
nmoorthy2001 2:53965de58fda 28 }
nmoorthy2001 2:53965de58fda 29 */
nmoorthy2001 2:53965de58fda 30
nmoorthy2001 2:53965de58fda 31 if(rx.readable())
nmoorthy2001 2:53965de58fda 32 {
nmoorthy2001 2:53965de58fda 33 count = 0;
nmoorthy2001 2:53965de58fda 34 while(rx.readable() && count < 12)
nmoorthy2001 2:53965de58fda 35 {
nmoorthy2001 2:53965de58fda 36 input[count] = rx.getc();
nmoorthy2001 2:53965de58fda 37 pc.printf("%d %c\n", count, input[count]);
nmoorthy2001 2:53965de58fda 38 lcd.locate(count,1);
nmoorthy2001 2:53965de58fda 39 lcd.putc(input[count]);
nmoorthy2001 2:53965de58fda 40 count++;
nmoorthy2001 2:53965de58fda 41 }
simon 0:df71eb8a3c0b 42 }
simon 0:df71eb8a3c0b 43 }
nmoorthy2001 2:53965de58fda 44
simon 0:df71eb8a3c0b 45 }