LCD display, Teraterm display

Dependencies:   ID12RFID ID12RFID_HelloWorld TextLCD mbed

Fork of ID12RFID_HelloWorld by Simon Ford

main.cpp

Committer:
nmoorthy2001
Date:
2015-05-09
Revision:
2:53965de58fda
Parent:
1:2c017f3d2d04
Child:
3:61e6bd867047

File content as of revision 2:53965de58fda:

//  Program for reading and matching RFID tags

#include "mbed.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


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);

    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++;       
            }
        }
    }

}