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
main.cpp
00001 #include "mbed.h" 00002 00003 Serial pc(SERIAL_TX, SERIAL_RX); 00004 00005 char nameStr[30]; 00006 int age = 1; 00007 00008 void getData() 00009 { 00010 pc.scanf("%s %d", &nameStr, &age); 00011 } 00012 00013 void printData() 00014 { 00015 pc.printf("Hello %s \n\r", nameStr); 00016 pc.printf("You are %d \n\r", age); 00017 } 00018 00019 int main() 00020 { 00021 int counter = 0; 00022 while (age > 0) 00023 { 00024 getData(); 00025 printData(); 00026 counter++; 00027 } 00028 pc.printf("You entered %d names\n", counter); 00029 sleep(); 00030 }
Generated on Mon Aug 22 2022 04:15:01 by
1.7.2