Kevin Anderson / Mbed 2 deprecated ClassLPC

Dependencies:   C12832 DataCommClassVersion mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "C12832.h"
00003 #include "DataComm.h"
00004 
00005 DataComm test;
00006 C12832 lcd(p5, p7, p6, p8, p11); //LCD structure
00007 void* data;
00008 int i=0;
00009 
00010 int main()
00011 {
00012     //clear lcd screen, print current build message
00013     lcd.cls();
00014     lcd.locate(0,3);
00015     lcd.printf("Testing receive data"); 
00016     test.setClockIn(p21); //clock in pin
00017     test.setSerialIn(p22); //data in pin        
00018     test.listen();
00019     //clear lcd screen, print current build message
00020     lcd.cls();
00021     lcd.locate(0,3);
00022     lcd.printf("Preamble Recieved"); 
00023     data = test.receive_data();
00024     //clear debugging message - and reset lcd to original position before printing data.
00025     lcd.cls();
00026     lcd.locate(0,3);
00027     lcd.printf("Received: "); 
00028     lcd.printf("%s", data);         
00029 }
00030 
00031 
00032 //listen runs in the address while loop - when listen returns because the preamble has been found
00033 //then it checks if the address is correct - if it isn't it goes back to listen - if it is end the loop to receive data.
00034 //addressing - while(!address)
00035                //{
00036                      //test.listen();
00037                      //if(test.check_address())
00038                      //     address = 1;
00039                //}