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: Control_Yokutan_CANver1 ADXL345_I2C mbed MPU6050
Fork of Souda_Yokutan_ver528TF by
Revision 47:5e3a836deaba, committed 2017-03-23
- Comitter:
- YusukeWakuta
- Date:
- Thu Mar 23 08:50:40 2017 +0000
- Branch:
- mpu????????
- Parent:
- 46:c722841055c7
- Child:
- 48:0bd406fa4a7f
- Commit message:
- LR??????
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Mar 22 13:47:03 2017 +0000
+++ b/main.cpp Thu Mar 23 08:50:40 2017 +0000
@@ -8,7 +8,7 @@
#define TO_SEND_DATAS_NUM 7
#define INIT_SERVO_PERIOD_MS 20
#define WAIT_LOOP_TIME 0.02
-#define CONTROL_VALUES_NUM sizeof(int) + 2
+#define CONTROL_VALUES_NUM 7
#define TO_SEND_CAN_ID 100
#define SEND_DATAS_LOOP_TIME 0.1
#define RECEIVE_DATAS_LOOP_TIME 0.1
@@ -17,14 +17,14 @@
#define MPU_DELT_MIN 250
#define ERURON_MOVE_DEG_INI_R 1.0
-#define DRUG_MOVE_DEG_INI_R 0.5
+#define DRUG_MOVE_DEG_INI_R -0.32
#define ERURON_TRIM_INI_R 0.35
-#define DRUG_TRIM_INI_R 0.37
+#define DRUG_TRIM_INI_R 0.62
#define ERURON_MOVE_DEG_INI_L 0.8
-#define DRUG_MOVE_DEG_INI_L -0.32
+#define DRUG_MOVE_DEG_INI_L -0.43
#define ERURON_TRIM_INI_L 0.4
-#define DRUG_TRIM_INI_L 0.62
+#define DRUG_TRIM_INI_L 0.68//値を小さくすると開く側
#define ERURON_MOVE_RANGE 0.24
@@ -161,7 +161,7 @@
pitch *= 180.0f / PI;
yaw *= 180.0f / PI;
roll *= 180.0f / PI;
- myled= !myled;
+ // myled= !myled;
count = t.read_ms();
sum = 0;
sumCount = 0;
@@ -252,7 +252,7 @@
drugServo.pulsewidth(calcPulse(drugTrim + drugMoveDeg *(float)controlValues[sizeof(int) + 2]));
eruronServo.pulsewidth(calcPulse( eruronTrim + eruronMoveDeg * ((1.0/PHASE_NUM) * eruronint) * ERURON_MOVE_RANGE));
pc.printf("WriteNum:%f ",calcPulse( eruronTrim + eruronMoveDeg * (1.0/PHASE_NUM) * eruronint* ERURON_MOVE_RANGE));
- pc.printf("drValue::%f ef::%d\n\r",drugTrim + drugMoveDeg *(float)controlValues[sizeof(float)],eruronint);
+ pc.printf("drValue::%f ef::%d\n\r",drugTrim + drugMoveDeg *(float)controlValues[sizeof(int) + 2],eruronint);
// pc.printf("raw:%f sampled:%f\n\r",eruronfloat /3.0,SampleFloat(eruronfloat / 3.0));
}
