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

Committer:
GregC
Date:
Mon Aug 15 03:58:02 2016 +0000
Revision:
0:79c0c4cd1ab3
Hexiwear Serial project

Who changed what in which revision?

UserRevisionLine numberNew contents of line
GregC 0:79c0c4cd1ab3 1 #include "mbed.h"
GregC 0:79c0c4cd1ab3 2
GregC 0:79c0c4cd1ab3 3 DigitalOut myled(LED_BLUE);
GregC 0:79c0c4cd1ab3 4 Serial pc(USBTX, USBRX);
GregC 0:79c0c4cd1ab3 5
GregC 0:79c0c4cd1ab3 6 int main()
GregC 0:79c0c4cd1ab3 7 {
GregC 0:79c0c4cd1ab3 8 int i = 0;
GregC 0:79c0c4cd1ab3 9 pc.printf("Hello World!\n");
GregC 0:79c0c4cd1ab3 10
GregC 0:79c0c4cd1ab3 11 while (true) {
GregC 0:79c0c4cd1ab3 12 wait(0.5f); // wait a small period of time
GregC 0:79c0c4cd1ab3 13 pc.printf("%d \n", i); // print the value of variable i
GregC 0:79c0c4cd1ab3 14 i++; // increment the variable
GregC 0:79c0c4cd1ab3 15 myled = !myled; // toggle a led
GregC 0:79c0c4cd1ab3 16 }
GregC 0:79c0c4cd1ab3 17 }
GregC 0:79c0c4cd1ab3 18