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 10:439e73c9a207, committed 2016-02-25
- Comitter:
- taurin
- Date:
- Thu Feb 25 09:12:31 2016 +0000
- Parent:
- 4:450cafd95ac3
- Child:
- 11:44fea1d768b5
- Commit message:
- aaaa
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Feb 24 10:21:46 2016 +0000
+++ b/main.cpp Thu Feb 25 09:12:31 2016 +0000
@@ -10,8 +10,10 @@
#define TO_SEND_CAN_ID 100
#define ADXL_MEAN_NUM 10
#define SEND_DATAS_LOOP_TIME 0.1
-#define ERURON_MOVE_DEG_INI 0
-#define DRUG_MOVE_DEG_INI 0
+#define ERURON_MOVE_DEG_INI 10
+#define DRUG_MOVE_DEG_INI -92
+#define ERURON_TRIM_INI 96
+#define DRUG_TRIM_INI 109
#define start 510
#define end 2390
@@ -38,8 +40,8 @@
char toSendDatas[TO_SEND_DATAS_NUM];
char controlValues[CONTROL_VALUES_NUM];//0:eruruon,1:drug
-float eruronTrim;
-float drugTrim;
+float eruronTrim = ERURON_TRIM_INI;
+float drugTrim = DRUG_TRIM_INI;
float eruronMoveDeg = ERURON_MOVE_DEG_INI;
float drugMoveDeg = DRUG_MOVE_DEG_INI;
unsigned short ina_val;
@@ -137,6 +139,7 @@
float b = drugAna.read()*180;
eruronServo.pulsewidth(calcPulse(eruronAna.read()*180));
drugServo.pulsewidth(calcPulse(drugAna.read()*180));
+ pc.printf("eruron:%f drug:%f\n\r",a,b);
}
else{
led3 = 0;
@@ -162,6 +165,7 @@
drugServo.pulsewidth(calcPulse(drugTemp));
eruronMoveDeg = eruronTemp-eruronTrim;
drugMoveDeg = drugTemp-drugTrim;
+ pc.printf("eMD:%f dMD:%f\n\r",eruronMoveDeg,drugMoveDeg);
wait_us(10);
}
