added gy80 dcm

Dependencies:   mbed DCM_AHRS_GY80 PID MMA8451Q

Fork of quadCommand by Greg Abdo

Committer:
gabdo
Date:
Tue Jul 02 21:03:46 2013 +0000
Revision:
56:a550127695b2
Parent:
55:bca9c9e92da6
Child:
59:9dfd9169a5e7
Problems with motor #2
;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gabdo 0:8681037b9a18 1 /******************************* motor.h *********************************/
gabdo 0:8681037b9a18 2 /* Version: 1.0 */
gabdo 0:8681037b9a18 3 /* Last Updated: June 1, 2013 */
gabdo 0:8681037b9a18 4 /* */
gabdo 0:8681037b9a18 5 /* The motor class is used for motor control using a PWM ECS. When a */
gabdo 0:8681037b9a18 6 /*a motor object is created you must pass the PWM pin as the only */
gabdo 0:8681037b9a18 7 /*argument. */
gabdo 0:8681037b9a18 8 /* */
gabdo 0:8681037b9a18 9 /* Wiring diagrams */
gabdo 0:8681037b9a18 10 /* _______ _______ */
gabdo 0:8681037b9a18 11 /* CW ----| | CCW ---\/ --| | */
gabdo 0:8681037b9a18 12 /* ----| Motor | ---/\---| Motor | */
gabdo 0:8681037b9a18 13 /* ----|_______| --/ \--|_______| */
gabdo 0:8681037b9a18 14 /* Straight through Switch wire 1 and 3 */
gabdo 0:8681037b9a18 15 /* */
gabdo 0:8681037b9a18 16 /*************************************************************************/
gabdo 0:8681037b9a18 17
gabdo 0:8681037b9a18 18
gabdo 0:8681037b9a18 19 #ifndef MOTOR_H
gabdo 0:8681037b9a18 20 #define MOTOR_H
gabdo 0:8681037b9a18 21
gabdo 0:8681037b9a18 22 #include "mbed.h"
gabdo 0:8681037b9a18 23
gabdo 0:8681037b9a18 24 class motor
gabdo 0:8681037b9a18 25 {
gabdo 0:8681037b9a18 26 public:
gabdo 0:8681037b9a18 27 motor( PinName ); // motor object constructor.
gabdo 56:a550127695b2 28 void setSpeed( int ); // Set the speed for the motor 0-100
gabdo 0:8681037b9a18 29 void setPulseMin( float ); // Set smallest pulse.
gabdo 0:8681037b9a18 30 void setPulseMax( float ); // Set largest pulse.
gabdo 56:a550127695b2 31 int getSpeed();
gabdo 0:8681037b9a18 32 float getPulse( void );
gabdo 0:8681037b9a18 33
gabdo 0:8681037b9a18 34 private:
gabdo 56:a550127695b2 35 PwmOut *pwmPin; // Pin used for PWM.
gabdo 56:a550127695b2 36 int currentSpeed; // Speed of the motor.
gabdo 0:8681037b9a18 37 float pulse; // Current pulse of the motor.
gabdo 0:8681037b9a18 38 float pulseMin; // Shortest value for the pulse
gabdo 55:bca9c9e92da6 39 float pulseMax; // Largest value for the pulse.
gabdo 55:bca9c9e92da6 40 float trim;
gabdo 0:8681037b9a18 41 };
gabdo 0:8681037b9a18 42
gabdo 0:8681037b9a18 43 #endif