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 ControlMain2017 by
ValueProcessor.h
00001 #ifndef VALUE_HANDLER 00002 #define VALUE_HANDLER 00003 00004 #include "mbed.h" 00005 00006 #define PHASE_NUM 7 //奇数にしてください。翼端コードと合わせないといけないのは、この値です 00007 #define ADDITIONALPHASE 2 00008 #define SUM_UP_NUM 10.0 00009 class ValueProcess 00010 { 00011 private: 00012 float rollNeutral; 00013 float rollUpperDiff; 00014 float rollLowerDiff; 00015 00016 float pitchNeutral;//1って書いた方 00017 float pitchUpperDiff; 00018 float pitchLowerDiff; 00019 float neutralDiff; 00020 00021 enum InputType { 00022 enumRoll, 00023 enumPitch 00024 }; 00025 public: 00026 ValueProcess(); 00027 void setNeutral(float rollRead,float pitchRead); 00028 void setMaxAndMin(InputType it,float value); 00029 float MatchUpperAndLower(InputType it, float max,float min,float neutral,float value); 00030 float Format2Range(float value,float max,float min); 00031 int PhaseFloat(float value,float max,float min); 00032 int WidenNeutral(int phased); 00033 float SetRollPitchRacio(float pitch,float roll); 00034 float MatchRange(float value); 00035 void Processing(float rollRead,float pitchRead,int* input_R,int* input_L); 00036 }; 00037 00038 #endif
Generated on Sat Jul 23 2022 22:09:59 by
