![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
02/07/15
Dependencies: mbed
Diff: UserInput.cpp
- Revision:
- 49:889751dd0395
- Parent:
- 48:e9578f56534a
- Child:
- 50:d794595c6868
--- a/UserInput.cpp Mon Jul 13 14:44:08 2015 +0000 +++ b/UserInput.cpp Wed Jul 15 13:52:20 2015 +0000 @@ -2,7 +2,7 @@ extern Serial pc; int sensorNumber; -float sensorDistance; +double sensorDistance; float input(){ pc.printf("Ready to Read.\n"); @@ -12,10 +12,10 @@ { pc.scanf("%d", &sensorNumber); pc.printf("Enter the distance between each sensor\n "); - pc.scanf("%f", &sensorDistance); + pc.scanf("%lf", &sensorDistance); //has to &lf because must know the size of it before getting it in break; } } - pc.printf("sensorNumber : %f \t sensorDistance : %d", sensorNumber, sensorDistance ); + pc.printf("sensorNumber : %d \t sensorDistance : %f", sensorNumber, sensorDistance ); return(sensorNumber, sensorDistance); } \ No newline at end of file