Rob Griffith / Mbed 2 deprecated rat_code

Dependencies:   mbed QEI

headers/motors.h

Committer:
rwgriffithv
Date:
2018-11-26
Revision:
3:35deb5c21b33
Parent:
0:88c60458332e

File content as of revision 3:35deb5c21b33:

#pragma once

const int PERIOD_US = 1000;

// Feel free to change these parameters as needed
const float MIN_SPEED = 0.08f;
const float MAX_SPEED = 0.2;

const int RIGHT_MOTOR = 0;
const int LEFT_MOTOR = 1;

class Motors {
public:
    Motors();
    void startBaseSpeed();
    void stop();

    /***
     * Range from 0.0-1.0.
     ***/
    void setLeftPwm(float pwm);
    void setRightPwm(float pwm);
private:
    void setMotorPwm(int motor, float pwm);
    
    float m_rpwm;
    float m_lpwm;
};