Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: ClassFRDM ClassLPC
Diff: main.cpp
- 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
}