George Hadley / Mbed 2 deprecated SerialIntro

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /****************************************************************************************
00002 * Date Created: 3/18/2010
00003 * Title: NBitWonder Serial Debugging Code Example
00004 * Description: An example serial communication program that prints values to a computer
00005 *       screen using the printf command.
00006 * Author: George Hadley
00007 * Website: http://nbitwonder.com
00008 ****************************************************************************************/
00009 #include "mbed.h"
00010 
00011 Serial pc(USBTX,USBRX);
00012 
00013 int main() {
00014     //print string values to pc terminal
00015     pc.printf("An mbed serial practice exercise\n\r");
00016     pc.printf("Writes values to the PC serial window\n\n\r");
00017     pc.printf("These values could just as easily be debug information, instead of silly strings\n\r");
00018     pc.printf("Now isn't that easy?\n\r");
00019     //wait indefinitely
00020     while(1) {
00021     }
00022 }