Kevin Anderson / DataCommClassVersion

Dependents:   ClassFRDM ClassLPC

Revision:
1:9cfb17f74dcd
Parent:
0:60c4436f7667
diff -r 60c4436f7667 -r 9cfb17f74dcd main.cpp
--- a/main.cpp	Thu Mar 19 02:36:11 2015 +0000
+++ b/main.cpp	Thu Mar 19 11:54:05 2015 +0000
@@ -1,16 +1,19 @@
 #include "mbed.h"
-#include "C12832.h"
 #include "DataComm.h"
 
-DataComm test;
-char data[4] = "Hi!";
+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()
 {
-    test.setClockOut(D8);
-    test.setSerialOut(D7);
-    test.setClock(2000);
-    test.initiate_connection();
-    test.setDataSize(3);
-    test.send_data(data);
+    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
 }