Quadcopter working with accelerômeter and accelerometer, and bluetooth radio for communication

Dependencies:   mbed

Committer:
jose_claudiojr
Date:
Tue May 21 14:12:13 2013 +0000
Revision:
0:56b8c86181b1
Quadcopter code with accelerometer and gyroscope.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jose_claudiojr 0:56b8c86181b1 1 #ifndef _MOTOR_H_
jose_claudiojr 0:56b8c86181b1 2 #define _MOTOR_H_
jose_claudiojr 0:56b8c86181b1 3
jose_claudiojr 0:56b8c86181b1 4 #include "mbed.h"
jose_claudiojr 0:56b8c86181b1 5 #include "Util.h"
jose_claudiojr 0:56b8c86181b1 6
jose_claudiojr 0:56b8c86181b1 7 //#define PWM_MIN 0.001
jose_claudiojr 0:56b8c86181b1 8 #define PWM_MIN 0.1
jose_claudiojr 0:56b8c86181b1 9 #define PWM_DT 0.001
jose_claudiojr 0:56b8c86181b1 10
jose_claudiojr 0:56b8c86181b1 11 class Motor : public PwmOut
jose_claudiojr 0:56b8c86181b1 12 {
jose_claudiojr 0:56b8c86181b1 13 public:
jose_claudiojr 0:56b8c86181b1 14 Motor(PinName pwm, float _period/*, float* linCoef, float lowerSat, float upperSat*/);
jose_claudiojr 0:56b8c86181b1 15 //Motor(PinName pwm, float periodms);
jose_claudiojr 0:56b8c86181b1 16
jose_claudiojr 0:56b8c86181b1 17 void setPower(float power);
jose_claudiojr 0:56b8c86181b1 18 void setPowerLin(float power);
jose_claudiojr 0:56b8c86181b1 19 void arm(int pwm_ms);
jose_claudiojr 0:56b8c86181b1 20 void accumulatePower(float accPower);
jose_claudiojr 0:56b8c86181b1 21
jose_claudiojr 0:56b8c86181b1 22 float getPower();
jose_claudiojr 0:56b8c86181b1 23
jose_claudiojr 0:56b8c86181b1 24 private:
jose_claudiojr 0:56b8c86181b1 25 float currentPower;
jose_claudiojr 0:56b8c86181b1 26 //float* linCoef;
jose_claudiojr 0:56b8c86181b1 27 //float lowerSat, upperSat;
jose_claudiojr 0:56b8c86181b1 28 };
jose_claudiojr 0:56b8c86181b1 29
jose_claudiojr 0:56b8c86181b1 30 #endif