![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
今までのジョイスティックの入力を段階分けしていた方式から、アナログ値をできる限りそのまま使用する方式に変更しました。
Fork of ControlMain2017 by
ValueProcessor.h@44:7b6f627a31da, 2017-04-28 (annotated)
- Committer:
- YusukeWakuta
- Date:
- Fri Apr 28 15:23:22 2017 +0000
- Branch:
- ?????
- Revision:
- 44:7b6f627a31da
- Parent:
- 43:2d8bffac06cd
- Child:
- 45:df3b45a8cecc
?????????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
YusukeWakuta | 42:6cc53727acc2 | 1 | #ifndef VALUE_HANDLER |
YusukeWakuta | 41:d2d123d7a6fa | 2 | #define VALUE_HANDLER |
YusukeWakuta | 41:d2d123d7a6fa | 3 | |
YusukeWakuta | 41:d2d123d7a6fa | 4 | #include "mbed.h" |
YusukeWakuta | 41:d2d123d7a6fa | 5 | |
YusukeWakuta | 44:7b6f627a31da | 6 | #define PHASE_NUM 23 //奇数にしてください |
YusukeWakuta | 44:7b6f627a31da | 7 | #define ADDITIONALPHASE 2 |
YusukeWakuta | 42:6cc53727acc2 | 8 | #define SUM_UP_NUM 10.0 |
YusukeWakuta | 41:d2d123d7a6fa | 9 | class ValueProcess |
YusukeWakuta | 41:d2d123d7a6fa | 10 | { |
YusukeWakuta | 43:2d8bffac06cd | 11 | private: |
YusukeWakuta | 42:6cc53727acc2 | 12 | float rollNeutral; |
YusukeWakuta | 42:6cc53727acc2 | 13 | float rollUpperDiff; |
YusukeWakuta | 42:6cc53727acc2 | 14 | float rollLowerDiff; |
YusukeWakuta | 41:d2d123d7a6fa | 15 | |
YusukeWakuta | 42:6cc53727acc2 | 16 | float pitchNeutral;//1って書いた方 |
YusukeWakuta | 42:6cc53727acc2 | 17 | float pitchUpperDiff; |
YusukeWakuta | 42:6cc53727acc2 | 18 | float pitchLowerDiff; |
YusukeWakuta | 41:d2d123d7a6fa | 19 | float neutralDiff; |
YusukeWakuta | 41:d2d123d7a6fa | 20 | |
YusukeWakuta | 42:6cc53727acc2 | 21 | enum InputType { |
YusukeWakuta | 42:6cc53727acc2 | 22 | enumRoll, |
YusukeWakuta | 42:6cc53727acc2 | 23 | enumPitch |
YusukeWakuta | 42:6cc53727acc2 | 24 | }; |
YusukeWakuta | 43:2d8bffac06cd | 25 | public: |
YusukeWakuta | 42:6cc53727acc2 | 26 | ValueProcess(); |
YusukeWakuta | 41:d2d123d7a6fa | 27 | void setNeutral(float rollRead,float pitchRead); |
YusukeWakuta | 41:d2d123d7a6fa | 28 | void setMaxAndMin(InputType it,float value); |
YusukeWakuta | 42:6cc53727acc2 | 29 | float MatchUpperAndLower(InputType it, float max,float min,float neutral,float value); |
YusukeWakuta | 42:6cc53727acc2 | 30 | float Format2Range(float value,float max,float min); |
YusukeWakuta | 42:6cc53727acc2 | 31 | int PhaseFloat(float value,float max,float min); |
YusukeWakuta | 44:7b6f627a31da | 32 | int ValueProcess::WidenNeutral(int phased); |
YusukeWakuta | 42:6cc53727acc2 | 33 | float SetRollPitchRacio(float pitch,float roll); |
YusukeWakuta | 43:2d8bffac06cd | 34 | float ValueProcess::MatchRange(float value); |
YusukeWakuta | 42:6cc53727acc2 | 35 | void ValueProcess::Processing(float rollRead,float pitchRead,int* input_R,int* input_L); |
YusukeWakuta | 41:d2d123d7a6fa | 36 | }; |
YusukeWakuta | 41:d2d123d7a6fa | 37 | |
YusukeWakuta | 41:d2d123d7a6fa | 38 | #endif |