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
- Committer:
- atir_sharif
- Date:
- 2022-01-08
- Revision:
- 1:71b75f1d31ca
- Parent:
- 0:06ea14e458e3
File content as of revision 1:71b75f1d31ca:
/*Program 5: Reads input voltage through the ADC, and transfers to PC terminal */ #include "mbed.h" Serial pc(USBTX, USBRX); //enable serial port which links to USB AnalogIn Ain(p20); Timer t; float tim; char a[20]; unsigned char count; int main() { // pc.printf("ADC Data Values…\n\r"); //send an opening text message while(1){ pc.scanf("%s", &a); t.start(); pc.printf("%s \n\r", &a); //send the data to the terminal t.stop(); pc.printf("The time taken was %f seconds\n", t.read()); tim = t.read(); count = strlen(a); tim /= count; pc.printf("The time taken for one charater %f seconds\n", tim); } }