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.
Controller.h
00001 #ifndef CONTROLLER_H_ 00002 #define CONTROLLER_H_ 00003 00004 /* Cntrl_Libary */ 00005 #include "EncoderCounter.h" 00006 #include "IIR_filter.h" 00007 #include "LinearCharacteristics.h" 00008 #include "PID_Cntrl.h" 00009 #include "ThreadFlag.h" 00010 00011 class Controller 00012 { 00013 public: 00014 00015 Controller(float Ts); 00016 00017 virtual ~Controller(); 00018 00019 void reset(); 00020 void start_loop(); 00021 00022 private: 00023 00024 Timer user_button_timer, loop_timer; 00025 float time_offset; 00026 bool executeMainTask, isFirstTimeMeas; 00027 InterruptIn user_button; 00028 00029 float Ts; 00030 00031 EncoderCounter encoderCounter; 00032 short count_past; 00033 long count; 00034 AnalogIn u_accx, u_accy, u_gyro; 00035 AnalogOut u_i; 00036 float time, accx, accy, gyro, phi1, phi2, dphi2, M; 00037 LinearCharacteristics u2accx, u2accy, u2gyro, i2u; 00038 IIR_filter Gacc, Ggyro, Gdiff, Gf; 00039 PID_Cntrl Ci; 00040 00041 BufferedSerial bufferedSerial; 00042 char buffer[200]; 00043 int write_counter, write_counter_write_val; 00044 00045 Mutex mutex; 00046 ThreadFlag threadFlag; 00047 Thread thread; 00048 Ticker ticker; 00049 00050 void loop(); 00051 void sendThreadFlag(); 00052 00053 void button_fall(); 00054 void button_rise(); 00055 }; 00056 00057 #endif
Generated on Thu Nov 17 2022 22:58:10 by
1.7.2