Luca Mottola / Mbed 2 deprecated AthensFall19-STDinSTDout

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 Serial pc(USBTX, USBRX);
00004 
00005 int main() {
00006     
00007     char buffer[128];
00008     pc.printf("Starting..\n");
00009 //    int count = 0;
00010 
00011     while (1) {
00012         pc.gets(buffer, 4);
00013         pc.printf("I got '%s'\n", buffer);
00014  
00015         // Alternate version to process data over serial from a host program...    
00016 //        pc.printf("The counter is '%d'\n", count);
00017 //        count++;
00018 //        wait (1);
00019     }
00020 }