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: ContinuousServo Tach mbed
Diff: main.cpp
- Revision:
- 0:a0013f51f232
- Child:
- 1:be893bda5f00
diff -r 000000000000 -r a0013f51f232 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Apr 23 15:15:49 2018 +0000
@@ -0,0 +1,25 @@
+#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;
+ }
+ }
+}