Interface with Parallax's high speed continuous rotation servo (Activity Bot)

Dependents:   ES202FinalProject ES202_FinalProject_workingExample DREAMTEAM ES202_straight1 ... more

Revision:
0:d6371727ce0c
diff -r 000000000000 -r d6371727ce0c ContinuousServo.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ContinuousServo.h	Fri Mar 02 16:51:35 2018 +0000
@@ -0,0 +1,39 @@
+
+/* Parallax High Speed Continuous Servo
+   John Donnal 2018
+*/
+
+#ifndef CONTINUOUS_SERVO_H
+#define CONTINUOUS_SERVO_H
+
+/**
+ * Includes
+ */
+#include "mbed.h"
+
+/**
+ * Parallax High Speed Continuous Servo Interface.
+ */
+class ContinuousServo {
+
+public:
+
+    /**
+     * Constructor.
+     *
+     * Drive Parallax servo (ActivityBot)
+     * -1: full speed reverse
+     *  0: stop
+     *  1: full speed forward
+     * @param output mbed pin for output channel.
+     */
+    ContinuousServo(PinName output);
+
+    void speed(float val);
+    void stop(void);
+private:
+
+    PwmOut servo_;
+};
+
+#endif /* CONTINUOUS_SERVO_H */