A simple program to test the functionality of Mbed serial pins.

Dependencies:   mbed

Fork of Serial_test by George Edwards

This code was inspired by the issues I faced with my Mbed. I had inadvertently blown up on of the serial ports, so I wrote this simple echo program. Just connect the serial output to the input and run the program. You should see messages appear on the serial terminal of your screen, diagnosing your issues.

main.cpp

Committer:
melmon
Date:
2015-06-24
Revision:
0:e148303bda4f

File content as of revision 0:e148303bda4f:

#include "mbed.h"              
/*
To use, make sure that you have a connection between your serial port tx and rx pins
*/ 
Serial pc(USBTX, USBRX);
Serial loop1(p9, p10);
Serial loop2(p13, p14);
 
int main() {
    pc.printf("You Should see a message about the port below: \n\r");
    loop1.printf("Serial Port 1 Works \n\r");
    loop2.printf("Serial Port 2 Works \n\r");
    while(1) {
        //pc.putc(loop1.getc());
        pc.putc(loop1.getc());
        
        
        
        
        
    }
}