Serial program example for Hexiwear

This project demonstrates the use of a Hexiwear Serial interface

Open a Hyperterminal tool on your computer and connect it to the "mbed Serial port (COMxx)" with Baud rate "9600bps"

Compile the project and copy the binary "Hexi_Serial_HEXIWEAR.bin" in the DAP-LINK drive from your computer file explorer
Press the K64F-RESET button on the docking station to start the program on your board

Message "Hello World!" will appear in the Hyperterminal window
Then every 500ms the value of an incremented variable will be displayed and Blue LED will blink accordingly

Files at this revision

API Documentation at this revision

Comitter:
GregC
Date:
Mon Aug 15 03:58:02 2016 +0000
Commit message:
Hexiwear Serial project

Changed in this revision

.gitignore Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 79c0c4cd1ab3 .gitignore
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.gitignore	Mon Aug 15 03:58:02 2016 +0000
@@ -0,0 +1,4 @@
+.build
+.mbed
+projectfiles
+*.py*
diff -r 000000000000 -r 79c0c4cd1ab3 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Aug 15 03:58:02 2016 +0000
@@ -0,0 +1,18 @@
+#include "mbed.h"
+
+DigitalOut myled(LED_BLUE);
+Serial pc(USBTX, USBRX);
+
+int main()
+{
+    int i = 0;
+    pc.printf("Hello World!\n");
+
+    while (true) {
+        wait(0.5f); // wait a small period of time
+        pc.printf("%d \n", i); // print the value of variable i
+        i++; // increment the variable
+        myled = !myled; // toggle a led
+    }
+}
+
diff -r 000000000000 -r 79c0c4cd1ab3 mbed-os.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Mon Aug 15 03:58:02 2016 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#0712b8adf6bbc7eb796d5dac26f95d79d40745ef