Nicholas Outram / Mbed OS Task131Solution
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 //Create an instance of a Serial object called pc
00004 //Transmit and receive pins have names USBTX and USBRX
00005 Serial pc(USBTX, USBRX);
00006 
00007 int main() {
00008 
00009     //Set the baud rate property (bits persecond)
00010     pc.baud(9600);
00011 
00012     //Run in an infinite loop
00013     while(1) {
00014         
00015         //Call the printf method on pc
00016         pc.printf("Hello World\n");
00017         
00018         //Wait for 1s
00019         wait(1.0);
00020     }
00021 }