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 71:a00561d455d1, committed 2017-10-21
- Comitter:
- tsumagari
- Date:
- Sat Oct 21 06:52:10 2017 +0000
- Branch:
- mpu????????
- Parent:
- 70:7da315abec17
- Child:
- 72:aef1ec8c66c7
- Commit message:
- can??????????servoOff????????
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Sep 29 09:17:11 2017 +0000
+++ b/main.cpp Sat Oct 21 06:52:10 2017 +0000
@@ -44,14 +44,15 @@
I2C ina226_i2c(p28,p27);
INA226 VCmonitor(ina226_i2c);
PwmOut drugServo(p23);
-PwmOut eruronServo(p24);
+PwmOut eruronServo(p25);
DigitalOut led1(LED1);
AnalogIn setDeg10(p20);
AnalogIn setDeg1(p19);
-DigitalIn IsRPin(p11,PullDown);
-DigitalIn InSetModePin(p12,PullDown);
-DigitalIn EDstatePin(p14,PullDown);
-DigitalIn TrimMaxDegPin(p15,PullDown);
+DigitalIn IsRPin(p13,PullDown);
+DigitalIn InSetModePin(p14,PullDown);
+DigitalIn EDstatePin(p15,PullDown);
+DigitalIn TrimMaxDegPin(p16,PullDown);
+DigitalOut servoOff(p17);
DigitalOut led2(LED2);
DigitalOut led3(LED3);
DigitalOut led4(LED4);
@@ -289,15 +290,17 @@
}
// toSendDatas[TO_SEND_DATAS_NUM - 1] = (char)(V/100);
toSendDatas[TO_SEND_DATAS_NUM - 1] = (char)V;
+ pc.printf("test\n\r");
}
void receiveDatas()
{
if(can.read(recmsg)) { //ここの中でpc.printfすると重すぎて固まるので注意
- for(int i = 0; i < 5; i++) {
+ for(int i = 0; i < CONTROL_VALUES_NUM; i++) {
floatValues[i] = recmsg.data[i];
}
drugInput = recmsg.data[5]- '0';
+ servoOff = recmsg.data[6]-'0';
eruronfloat = atof(floatValues);
led1 = !led1;
}
@@ -373,7 +376,8 @@
led4 = 0;
led2 = 0;
receiveDatas();
-// sendDatas();
+ sendDatas();
+ pc.printf("V:%f\n\r",V);
WriteServo();
updateDatas();
led3 = !led3;
