QuadroCopter  0.1.4
dji_2212.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2017 Michael Brookes
3 
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17 
18 #ifndef BEAGLEBONE_MOTOR_DJI_2212_H
19 #define BEAGLEBONE_MOTOR_DJI_2212_H
20 
21 #include "../motors.h"
22 
23 namespace quadro {
24 
25  namespace pwm {
26 
27  using namespace quadro::overlays;
28 
32  class dji_2212 : public motors {
33 
34  const long MAX_DUTY = 320000; //150000
35  const long MIN_DUTY = 500000;
36  const long SPIN_SLOWSPEED = 700000;
37  const long SPIN_TAKEOFFSPEED = 250000;
38  const long DEFAULT_PERIOD = 1900000;
39  const long ACTIVATE_PERIOD = 1200000;
40  const int DEFAULT_SPEED_STEP = 50;
41 
42  public:
43 
50  dji_2212( pinBlocks _block, PWMPins _pin );
51 
55  void init();
56 
62  void setDuty( long _duty );
63 
69  void setPeriod( long _period );
70 
76  void setRun( int _run );
77 
83  void setPolarity( int _polarity );
84 
85  };
86 
87  }
88 
89 }
90 
91 #endif //BEAGLEBONE_MOTOR_DJI_2212_H
Definition: motors.h:31
pinBlocks
Definition: overlayBase.h:43
Definition: dji_2212.h:32
Definition: aeronautics.h:23
PWMPins
PinNum refers to a exposed PWM Pin on your BBB, this enum can be expanded to include more if required...
Definition: overlayBase.h:51
Definition: overlaySetupException.h:14