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
Diff: Distance.cpp
- Revision:
- 36:a2d20d5e5e19
- Parent:
- 27:f3ca0269515f
- Child:
- 40:23008d8111d5
diff -r 085a674c9fdf -r a2d20d5e5e19 Distance.cpp
--- a/Distance.cpp Wed Jul 08 07:11:31 2015 +0000
+++ b/Distance.cpp Wed Jul 08 08:38:37 2015 +0000
@@ -4,9 +4,9 @@
float radius;
int number_sensors;
-float distance;
+float distance_out;
-float Distance(){
+float distance(){
pc.printf("Ready to Read.\n Enter the Radius\n");
while (1){
if (pc.readable()){
@@ -15,10 +15,10 @@
pc.printf("Enter the number of sensors\n");
pc.scanf("%d", &number_sensors);
pc.printf("The number of sensors have been resived\n ");
- distance = (2*radius*3.14159)/number_sensors;
+ distance_out = (2*radius*3.14159)/number_sensors;
break;
}
}
pc.printf("The distance has be calulated and is ");
- return(distance);//returns the distance in as a float
+ return(distance_out);//returns the distance in as a float
}
\ No newline at end of file