added gy80 dcm
Dependencies: mbed DCM_AHRS_GY80 PID MMA8451Q
Fork of quadCommand by
quadCommand/motor/motor.h
- Committer:
- gabdo
- Date:
- 2013-06-10
- Revision:
- 45:088885f4a13d
- Parent:
- 38:9f33129afce2
- Child:
- 55:bca9c9e92da6
File content as of revision 45:088885f4a13d:
/******************************* motor.h *********************************/ /* Version: 1.0 */ /* Last Updated: June 1, 2013 */ /* */ /* The motor class is used for motor control using a PWM ECS. When a */ /*a motor object is created you must pass the PWM pin as the only */ /*argument. */ /* */ /* Wiring diagrams */ /* _______ _______ */ /* CW ----| | CCW ---\/ --| | */ /* ----| Motor | ---/\---| Motor | */ /* ----|_______| --/ \--|_______| */ /* Straight through Switch wire 1 and 3 */ /* */ /*************************************************************************/ #ifndef MOTOR_H #define MOTOR_H #include "mbed.h" class motor { public: motor( PinName ); // motor object constructor. void setSpeed( float ); // Set the speed for the motor 0-100 void setPulseMin( float ); // Set smallest pulse. void setPulseMax( float ); // Set largest pulse. float getSpeed(); float getPulse( void ); private: PwmOut _pwm; // Pin used for PWM. float currentSpeed; // Speed of the motor. float pulse; // Current pulse of the motor. float pulseMin; // Shortest value for the pulse float pulseMax; // Largest value for the pulse.. }; #endif