Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of mDot_Serial_Example by
main.cpp
00001 /** mDot Serial Example Program 00002 * 00003 * This program demonstrates how to do handle a serial port 00004 * using the MultiTech mDot and MultiTech UDK2 hardware. 00005 * 00006 * This program echos characters on the debug serial port. 00007 * The debug serial port is operated at the default baud, 9600. 00008 * Connect your terminal application to the appropriate COM/tty 00009 * port on your PC. See https://developer.mbed.org/handbook/SerialPC 00010 * for details. 00011 */ 00012 00013 #include "mbed.h" 00014 #include <string> 00015 00016 00017 00018 //Serial pc(USBTX, USBRX); 00019 00020 //Serial pc(PA_2, PA_3); 00021 00022 Serial pc(USBTX, USBRX); 00023 00024 Serial device(PA_2, PA_3); // tx, rx 00025 00026 int main() { 00027 device.baud(9600); 00028 while(1) { 00029 /*(pc.readable()) { 00030 device.putc(pc.getc()); 00031 00032 }*/ 00033 00034 00035 00036 //delay(500); 00037 if(device.readable()) { 00038 pc.putc('h'); 00039 pc.putc('\r'); 00040 // pc.putc(device.getc()); 00041 } 00042 } 00043 } 00044 00045 00046
Generated on Thu Jul 14 2022 23:27:30 by
