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

Dependencies:   Tach

Dependents:   EW202FP_Stop

ContinuousServo.h

Committer:
m211002
Date:
2019-04-17
Revision:
1:f1fc02b6744f
Parent:
0:d6371727ce0c

File content as of revision 1:f1fc02b6744f:


/* 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 */