今までのジョイスティックの入力を段階分けしていた方式から、アナログ値をできる限りそのまま使用する方式に変更しました。

Dependencies:   mbed-rtos mbed

Fork of ControlMain2017 by albatross

Files at this revision

API Documentation at this revision

Comitter:
YusukeWakuta
Date:
Fri Jun 02 05:21:47 2017 +0000
Branch:
?????
Parent:
47:6f84dcf7d1d8
Commit message:
valueprocessor??????push; ;

Changed in this revision

ValueProcessor.cpp Show annotated file Show diff for this revision Revisions of this file
ValueProcessor.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 6f84dcf7d1d8 -r 2965c51ef540 ValueProcessor.cpp
--- a/ValueProcessor.cpp	Sat May 13 15:20:43 2017 +0000
+++ b/ValueProcessor.cpp	Fri Jun 02 05:21:47 2017 +0000
@@ -152,7 +152,6 @@
 
 void ValueProcess::Processing(float rollRead,float pitchRead,int* input_R,int* input_L)
 {
-
     setMaxAndMin(enumRoll, rollRead);
     setMaxAndMin(enumPitch, pitchRead);
 
@@ -166,10 +165,10 @@
 
     int phased_R=PhaseFloat(Formated_R,SetRollPitchRacio(pitchNeutral + pitchUpperDiff,rollNeutral + rollUpperDiff),SetRollPitchRacio(pitchNeutral + pitchLowerDiff,rollNeutral + rollLowerDiff));
     // *input_R = WidenNeutral(phased_R);
-    *input_R = phased_R;
+    *input_R = phased_R;//WidenNeutral( phased_R);
     float Formated_L = Format2Range(SetRollPitchRacio(MatchedPitch, - MatchedRoll),SetRollPitchRacio(pitchNeutral + pitchUpperDiff,-rollNeutral - rollLowerDiff),SetRollPitchRacio(pitchNeutral  +pitchLowerDiff, - rollNeutral - rollUpperDiff));
     int phased_L = PhaseFloat(Formated_L,SetRollPitchRacio(pitchNeutral + pitchUpperDiff ,- rollNeutral - rollLowerDiff),SetRollPitchRacio(pitchNeutral + pitchLowerDiff ,- rollNeutral - rollUpperDiff));
-    *input_L = WidenNeutral(phased_R);
+    *input_L = phased_L;             // WidenNeutral(phased_L);
 
     if(*input_R < 1)
         *input_R = 1;
@@ -179,4 +178,4 @@
         *input_L = 1 ;
     else if(*input_L > PHASE_NUM)
         *input_L =PHASE_NUM;
-}
+}
\ No newline at end of file
diff -r 6f84dcf7d1d8 -r 2965c51ef540 ValueProcessor.h
--- a/ValueProcessor.h	Sat May 13 15:20:43 2017 +0000
+++ b/ValueProcessor.h	Fri Jun 02 05:21:47 2017 +0000
@@ -3,7 +3,7 @@
 
 #include "mbed.h"
 
-#define PHASE_NUM 15 //奇数にしてください。翼端コードと合わせないといけないのは、この値です
+#define PHASE_NUM 7 //奇数にしてください。翼端コードと合わせないといけないのは、この値です
 #define ADDITIONALPHASE 2
 #define SUM_UP_NUM 10.0
 class ValueProcess
diff -r 6f84dcf7d1d8 -r 2965c51ef540 main.cpp
--- a/main.cpp	Sat May 13 15:20:43 2017 +0000
+++ b/main.cpp	Fri Jun 02 05:21:47 2017 +0000
@@ -65,7 +65,7 @@
 void InputControlValues()
 {
     VP.Processing(rollPin.read(),pitchPin.read(),(int *)inputDatas_R,(int *)inputDatas_L);
-    pc.printf("R:%d     L:%d    show Both Right\n\r",*(int *)inputDatas_R,*(int *)inputDatas_L);
+    pc.printf("R:%d     L:%d    show Both Right %d %d\n\r",*(int *)inputDatas_R,*(int *)inputDatas_L,drug_R.read(), drug_L.read());
     inputDatas_R[sizeof(int)+ 2] = (char)drug_R;
     inputDatas_L[sizeof(int)+2] = (char)drug_L;
      led4 =! led4;