Weston and Ivan / ContinuousServo

Dependencies:   Tach

Dependents:   EW202FP_Stop

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ContinuousServo.h Source File

ContinuousServo.h

00001 
00002 /* Parallax High Speed Continuous Servo
00003    John Donnal 2018
00004 */
00005 
00006 #ifndef CONTINUOUS_SERVO_H
00007 #define CONTINUOUS_SERVO_H
00008 
00009 /**
00010  * Includes
00011  */
00012 #include "mbed.h"
00013 
00014 /**
00015  * Parallax High Speed Continuous Servo Interface.
00016  */
00017 class ContinuousServo {
00018 
00019 public:
00020 
00021     /**
00022      * Constructor.
00023      *
00024      * Drive Parallax servo (ActivityBot)
00025      * -1: full speed reverse
00026      *  0: stop
00027      *  1: full speed forward
00028      * @param output mbed pin for output channel.
00029      */
00030     ContinuousServo(PinName output);
00031 
00032     void speed(float val);
00033     void stop(void);
00034 private:
00035 
00036     PwmOut servo_;
00037 };
00038 
00039 #endif /* CONTINUOUS_SERVO_H */