zhao hao / Mbed 2 deprecated Nucleo_printf

Dependencies:   mbed

main.cpp

Committer:
19010100419
Date:
2021-05-07
Revision:
3:7d5a6c251111
Parent:
2:c9378e6122a7

File content as of revision 3:7d5a6c251111:

#include "mbed.h"
#include <string.h>

//------------------------------------
// Hyperterminal configuration
// 9600 bauds, 8-bit data, no parity
//------------------------------------
Serial pc(SERIAL_TX, SERIAL_RX);
DigitalOut myled(LED1);
 /*
 * Author: Edoardo De Marchi
 * Date: 22-08-14
 * Notes: Firmware for GPS U-Blox NEO-6M
*/



int main() 
{   
    pc.printf("Press 'u' to turn LED on,'d' for off\n");
    while(1) 
    {
         char c = pc.getc();
        wait (0.001);
        if(c == 'u')
        {
           myled = 1; 
            }
         if(c == 'd')
        {
           myled = 0; 
            }   
}

}