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.
Dependencies: ADXL345_I2C Control_Yokutan_CANver1 mbed
Fork of Souda_Yokutan_ver3 by
Revision 14:1f6dd929d7de, committed 2016-02-27
- Comitter:
- YusukeWakuta
- Date:
- Sat Feb 27 11:36:09 2016 +0000
- Parent:
- 13:5e3b4120dbbf
- Child:
- 15:1db5ee4fe7ce
- Commit message:
- ??????????????
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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();
