This demo program output text to the serial link once a second. It was written as part of the Heriot Watt Robotics Society Hamilton Circle Electronics Workshop

Dependencies:   mbed

main.cpp

Committer:
coloursearch
Date:
2017-11-09
Revision:
0:be67304b610a

File content as of revision 0:be67304b610a:

#include "mbed.h"              
 
Serial pc(USBTX, USBRX);

int counter = 0;
 
int main() {

    while(1) {
        counter++;
        if(counter % 10 == 0){
            pc.printf("%d\n\r", counter);
        }
        wait(0.1);
    }
}