![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
First run
Dependencies: ContinuousServo Tach mbed
main.cpp
- Committer:
- nbchaskin
- Date:
- 2018-04-23
- Revision:
- 0:a0013f51f232
- Child:
- 1:be893bda5f00
File content as of revision 0:a0013f51f232:
#include "mbed.h" #include "ContinuousServo.h" #include "Tach.h" Tach tLeft(p17,64); Tach tRight(p13,64); ContinuousServo left(p23); ContinuousServo right(p26); AnalogIn sonar(p19); float distance; int main() { while(1) { distance = //inches; distance = //conversion to analog value; if (sonar > distance){ left.speed(); right.speed(); } else { break; } } }