jetfishteam / Mbed 2 deprecated brushless_test

Dependencies:   ESC Servo mbed

Fork of brushlessmotor by jetfishteam

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MainController.h Source File

MainController.h

00001 #ifndef MBED_MAINCONTROLLER_H
00002 #define MBED_MAINCONTROLLER_H
00003  
00004 #include "mbed.h"
00005 #include "esc.h"
00006 
00007 #define MATH_PI 3.14159265359
00008 #define TOFF 0.03
00009 class MainController {
00010 public:
00011     /** Create a MainController
00012      *
00013      * @param 
00014      */ 
00015     MainController() ;
00016     
00017     /** Start the main controller
00018      * @returns 
00019      */
00020     void start();
00021     float getDutyCycle();
00022     float getAmplitude();
00023 
00024     /** Stop the main controller
00025      * @returns 
00026      */
00027     void stop();
00028     
00029 protected:        
00030     void control();
00031     //float calculateAdj();
00032     float signum(float input);
00033     float saturate(float input);
00034     
00035 private:
00036     ESC esc1;
00037     
00038     Timer timer1;
00039     Ticker ticker1;
00040     float amp;
00041     float dutyCycle;
00042     float curTime;
00043     float frqMin;
00044     float frqMax;    
00045     PwmOut myled;
00046     AnalogIn mypotentiometer;
00047     
00048 };
00049  
00050 #endif