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 00003 00004 00005 Serial pc(USBTX, USBRX); // tx, rx 00006 00007 int j=0; 00008 int x=0; 00009 00010 00011 char X_buffer []= {0,0}; //2 item array 00012 00013 00014 00015 void readSerialString () 00016 { 00017 j=0; 00018 while(j<=1) { 00019 X_buffer[j] = pc.getc(); 00020 j++; 00021 } 00022 00023 } 00024 00025 00026 int main() 00027 00028 { 00029 pc.baud(115200); 00030 00031 while(1) { 00032 readSerialString (); 00033 00034 00035 x=atoi(X_buffer); //convert to int 00036 00037 pc.printf("%d\n",x); 00038 00039 } 00040 }
Generated on Sat Jul 23 2022 02:14:28 by
1.7.2