Kevin Anderson / DataCommClassVersion

Dependents:   ClassFRDM ClassLPC

main.cpp

Committer:
askksa12543
Date:
2015-03-19
Revision:
1:9cfb17f74dcd
Parent:
0:60c4436f7667

File content as of revision 1:9cfb17f74dcd:

#include "mbed.h"
#include "DataComm.h"

DataComm test; //create data communication protocol variable
char data[4] = "Hi!"; //test data
int size = 3;
DigitalOut myled(LED1); // red led on board

int main()
{
    myled = 1; //turn off led
    test.setClockOut(D8); //clock out pin
    test.setSerialOut(D7); //data out pin
    test.setClock(2000); //set 2 second clock
    test.initiate_connection(); //send preamble
    test.send_data(data, size); //send data
    test.close_connection(); //send postamble
    myled = 0; //turn on led to indicate completion of code
}