Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of brushlessmotor by
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
Generated on Tue Jul 12 2022 21:22:42 by
1.7.2
