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 XBusServo mbed mbed-rtos
Fork of ControlYokutan2017_2 by
Revision 32:b03557a08efa, committed 2017-03-10
- Comitter:
- YusukeWakuta
- Date:
- Fri Mar 10 12:59:41 2017 +0000
- Branch:
- XBus???
- Parent:
- 31:5d22ebe5f705
- Child:
- 33:d075918d4846
- Child:
- 34:53d2723d9195
- Commit message:
- ????0???
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Mar 10 10:38:17 2017 +0000
+++ b/main.cpp Fri Mar 10 12:59:41 2017 +0000
@@ -12,15 +12,15 @@
#define SEND_DATAS_LOOP_TIME 0.1
#define RECEIVE_DATAS_LOOP_TIME 0.05
-#define ERURON_MOVE_DEG_INI_R 30
-#define DRUG_MOVE_DEG_INI_R 76
-#define ERURON_TRIM_INI_R 97
-#define DRUG_TRIM_INI_R 33
+#define ERURON_MOVE_DEG_INI_R 0
+#define DRUG_MOVE_DEG_INI_R 0
+#define ERURON_TRIM_INI_R 0
+#define DRUG_TRIM_INI_R 0
-#define ERURON_MOVE_DEG_INI_L -30
-#define DRUG_MOVE_DEG_INI_L -80
-#define ERURON_TRIM_INI_L 113
-#define DRUG_TRIM_INI_L 110
+#define ERURON_MOVE_DEG_INI_L 0
+#define DRUG_MOVE_DEG_INI_L 0
+#define ERURON_TRIM_INI_L 0
+#define DRUG_TRIM_INI_L 0
#define kMaxServoNum 1 // 1 - 50
#define kMaxServoPause (sizeof(motionData) / sizeof(pauseRec))
@@ -177,7 +177,7 @@
void XbusIntervalHandler()
{
uint16_t diff = kMotionEndMark - kMotionMinMark;
- XbusValue = (uint16_t)(diff * (eruronTrim + eruronMoveDeg * (eruronfloat-1)) + kMotionMinMark);
+ XbusValue = (uint16_t)(diff * (eruronTrim + eruronMoveDeg * eruronfloat / 2.0) + kMotionMinMark);
//pc.printf("%f",value);
gXBus.setServo(servoChannel, XbusValue);
gXBus.sendChannelDataPacket();
@@ -240,8 +240,9 @@
setMaxDeg();
}
// pc.printf("eT:%f\n\r",eruronTrim);
- // pc.printf("eruronTrim:%f drugTrim:%f ",eruronTrim,drugTrim);
- //pc.printf("eMD:%f dMD:%f ef:%f\n\r",eruronMoveDeg,drugMoveDeg,eruronfloat);
+ pc.printf("eruronTrim:%f drugTrim:%f ",eruronTrim,drugTrim);
+ pc.printf("eMD:%f dMD:%f ef:%f\n\r",eruronMoveDeg,drugMoveDeg,eruronfloat);
+ // pc.printf("%c,%c,%c,DG:%c\n\r",controlValues[0],controlValues[1],controlValues[2],controlValues[3]);
led4 = 0;
debugLED = 0;
@@ -250,7 +251,7 @@
WriteServo();
updateDatas();
// pc.printf("%6d,%6d,%6d\n\r",gyro[0],gyro[1],gyro[2]);
- pc.printf("%f\n\r",XbusValue);
+ // pc.printf("%f\n\r",XbusValue);
led3 = !led3;
wait(WAIT_LOOP_TIME);
}
