Serial Example for hexiwear

main.cpp

Committer:
GregC
Date:
2016-08-15
Revision:
0:79c0c4cd1ab3
Child:
1:a758914c25d5

File content as of revision 0:79c0c4cd1ab3:

#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
    }
}