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:
- simplyellow
- Date:
- 2016-10-24
- Revision:
- 0:d97c87993116
- Child:
- 1:532b7273ebc6
File content as of revision 0:d97c87993116:
#include "mbed.h"
#include "Motor.h"
//Motor turn(p23, p28);
AnalogIn pot(p15);
Serial pc(USBTX, USBRX);
float value;
float angle;
/*
the angular range of the pot is 66.8 degrees
the average float range is 0.2226
so +/- 33.4 degrees
*/
int main() {
while(1){
value = (float) pot;
angle = value
pc.printf("%f\n\r", angle);
wait(0.2);
}
}
/* DumpTruck pot measurements
0.274 to 0.498 -> 0.224
0.272 to 0.495 -> 0.223
0.277 to 0.498 -> 0.221
*/