Curtis Sellier / Mbed 2 deprecated Project_Car_Curtis_Non_Tested

Dependencies:   Servo mbed

Files at this revision

API Documentation at this revision

Comitter:
kmarangi
Date:
Fri Oct 07 11:02:23 2016 +0000
Child:
1:8c1e3382b4d7
Commit message:
test servo

Changed in this revision

Servo.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Fri Oct 07 11:02:23 2016 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/simon/code/Servo/#36b69a7ced07
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Oct 07 11:02:23 2016 +0000
@@ -0,0 +1,30 @@
+#include "mbed.h"
+#include "Servo.h"
+Serial pc(USBTX, USBRX); // USB serial interface
+Servo cr_srv1(p21); // continuous rotation hobby servo right
+Servo cr_srv2(p22); // continuous rotation hobby servo left
+
+void init_servo() {
+ // calibrate the servos for +/-5ms over +/-45deg
+ cr_srv1.calibrate(0.0005,45);
+ cr_srv2.calibrate(0.0005,45);
+}
+int main() {
+
+
+ // set the USB serial interface baud rate
+ pc.baud(921600);
+
+ init_servo();
+
+ while(1) {
+
+
+ // sernd the servo command to the servos themselves
+ cr_srv1.write(0.6); // write to the continuous rotation servo1
+ cr_srv2.write(0.4); // write to the continous servo2
+
+ }
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Oct 07 11:02:23 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/25aea2a3f4e3
\ No newline at end of file