動作試験用のプログラムです。

Dependencies:   ADXL345_I2C Control_Yokutan_CANver1 mbed

Fork of Control_Yokutan_CAN_ver4 by albatross

Files at this revision

API Documentation at this revision

Comitter:
YusukeWakuta
Date:
Sat Feb 27 11:36:09 2016 +0000
Parent:
13:5e3b4120dbbf
Commit message:
??????????????

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 5e3b4120dbbf -r 1f6dd929d7de main.cpp
--- a/main.cpp	Sat Feb 27 04:33:21 2016 +0000
+++ b/main.cpp	Sat Feb 27 11:36:09 2016 +0000
@@ -11,15 +11,15 @@
 #define ADXL_MEAN_NUM 10
 #define SEND_DATAS_LOOP_TIME 0.1
 
-#define ERURON_MOVE_DEG_INI_R 1
-#define DRUG_MOVE_DEG_INI_R 1
-#define ERURON_TRIM_INI_R 1
-#define DRUG_TRIM_INI_R 1
+#define ERURON_MOVE_DEG_INI_R 55
+#define DRUG_MOVE_DEG_INI_R 96
+#define ERURON_TRIM_INI_R 41
+#define DRUG_TRIM_INI_R 3
 
-#define ERURON_MOVE_DEG_INI_L 2
-#define DRUG_MOVE_DEG_INI_L 2
-#define ERURON_TRIM_INI_L 2
-#define DRUG_TRIM_INI_L 2
+#define ERURON_MOVE_DEG_INI_L 29
+#define DRUG_MOVE_DEG_INI_L 87
+#define ERURON_TRIM_INI_L 79
+#define DRUG_TRIM_INI_L 92
 
 CAN can(p30,p29);
 CANMessage recmsg;
@@ -175,7 +175,9 @@
     drugTrim = drugAna.read()*180;
     drugServo.pulsewidth(calcPulse(drugTrim));
     }
-    pc.printf("eruronTrim:%f    drugTrim:%f\n\r",eruronTrim,drugTrim);
+    //pc.printf("eruronTrim:%f    drugTrim:%f\n\r",eruronTrim,drugTrim);
+     pc.printf("eruronTrim:%f    drugTrim:%f    ",eruronTrim,drugTrim);
+      pc.printf("eMD:%f   dMD:%f\n\r",eruronMoveDeg,drugMoveDeg);
 }
 
 void checkMaxDeg(){
@@ -190,7 +192,9 @@
     drugServo.pulsewidth(calcPulse(drugTemp));
     drugMoveDeg = drugTemp-drugTrim;
     }
-    pc.printf("eMD:%f   dMD:%f\n\r",eruronMoveDeg,drugMoveDeg);
+   // pc.printf("eMD:%f   dMD:%f\n\r",eruronMoveDeg,drugMoveDeg);
+    pc.printf("eruronTrim:%f    drugTrim:%f    ",eruronTrim,drugTrim);
+      pc.printf("eMD:%f   dMD:%f\n\r",eruronMoveDeg,drugMoveDeg);
     wait_us(10);
 }
 
@@ -203,8 +207,11 @@
         while(checkMaxDegPin){
             checkMaxDeg();
         }
-        pc.printf("eT:%f\n\r",eruronTrim);
+      //  pc.printf("eT:%f\n\r",eruronTrim);
+      pc.printf("eruronTrim:%f    drugTrim:%f    ",eruronTrim,drugTrim);
+      pc.printf("eMD:%f   dMD:%f\n\r",eruronMoveDeg,drugMoveDeg);
         led4 = 0;
+        
         debugLED = 0;
         receiveDatas();
         WriteServo();