![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
02/07/15
Dependencies: mbed
UserInput.cpp
- Committer:
- aidanPJG
- Date:
- 2015-07-13
- Revision:
- 48:e9578f56534a
- Child:
- 49:889751dd0395
File content as of revision 48:e9578f56534a:
#include "mbed.h" extern Serial pc; int sensorNumber; float sensorDistance; float input(){ pc.printf("Ready to Read.\n"); pc.printf("Enter the number of sensors\n"); while (1){ if (pc.readable()) { pc.scanf("%d", &sensorNumber); pc.printf("Enter the distance between each sensor\n "); pc.scanf("%f", &sensorDistance); break; } } pc.printf("sensorNumber : %f \t sensorDistance : %d", sensorNumber, sensorDistance ); return(sensorNumber, sensorDistance); }