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 Infra-RedSeonsor by
Revision 1:9d0c57c475ce, committed 2018-04-04
- Comitter:
- kurikuri
- Date:
- Wed Apr 04 06:12:54 2018 +0000
- Parent:
- 0:b40d3d1793b1
- Commit message:
- cm??;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Apr 04 02:10:50 2018 +0000 +++ b/main.cpp Wed Apr 04 06:12:54 2018 +0000 @@ -6,8 +6,12 @@ int main() { while(1){ - distance = ain.read(); - pc.printf("Distance:%f\n\r",distance); + double x = 0; + for(int i=0;i<10;i++){ + distance = 53.444*pow(double(ain.read()),-1.736)/10; + x += distance; + } + pc.printf("Distance:%f\n\r",x/10); wait(0.5); } }