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.
main.cpp
00001 #include "mbed.h" 00002 #include "C027.h" 00003 00004 DigitalOut mdm_activity(LED); 00005 00006 int main() 00007 { 00008 int led_toggle_count = 5; 00009 00010 C027 c027; 00011 c027.mdmPower(true,false); 00012 00013 #if 0 00014 while(1) { 00015 mdm_activity = !mdm_activity; 00016 wait(0.2); 00017 } 00018 #else 00019 while( led_toggle_count-- > 0 ) 00020 { 00021 mdm_activity = !mdm_activity; 00022 wait(0.2); 00023 } 00024 #endif 00025 00026 // open the mdm serial port 00027 Serial mdm(MDMTXD, MDMRXD); 00028 mdm.baud(MDMBAUD); 00029 // tell the modem that we can always receive data 00030 DigitalOut mdmRts(MDMRTS); 00031 mdmRts = 0; // (not using flow control) 00032 00033 // open the PC serial port and (use the same baudrate) 00034 Serial pc(USBTX, USBRX); 00035 pc.baud(MDMBAUD); 00036 00037 while (1) 00038 { 00039 // transfer data from pc to modem 00040 if (pc.readable() && pc.writeable()) 00041 pc.putc(pc.getc()); 00042 } 00043 }
Generated on Wed Aug 10 2022 12:45:12 by
