//Simple program allowing user to recieve string from STM32F4 and output it through com port

Dependencies:   mbed

Fork of FRDM-K64F-UARTCOMMS by Demo Team

main.cpp

Committer:
andcor02
Date:
2015-03-04
Revision:
1:e1492422d835
Parent:
0:f682dcf80f00

File content as of revision 1:e1492422d835:

#include "mbed.h"
//Simple program allowing user to recieve string from STM32F4 and output it through com port
//Andrea Corrado
Serial pc(USBTX, USBRX); // tx, rx
Serial uart (PTC17, PTC16);
char strn [17];
char c;

int main()
{
    while(1) {
//        if (pc.readable()) {
//            uart.putc(pc.getc()); //trans
//        }
        if (uart.readable()) {
            uart.gets(strn, 17);
            pc.printf ("\n\r%s", strn);
        }
    }
}