計測輪ボード用プログラム
Dependencies: SerialMultiByte measuring_wheel SoftPWM Eigen
Revision 6:f4a6cc918833, committed 2019-09-03
- Comitter:
- ec30109b
- Date:
- Tue Sep 03 05:37:17 2019 +0000
- Parent:
- 5:9332620c08c6
- Commit message:
- measuring wheel
Changed in this revision
diff -r 9332620c08c6 -r f4a6cc918833 Eigen.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Eigen.lib Tue Sep 03 05:37:17 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/ykuroda/code/Eigen/#13a5d365ba16
diff -r 9332620c08c6 -r f4a6cc918833 SerialMultiByte.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SerialMultiByte.lib Tue Sep 03 05:37:17 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/teams/NHK-Robocon2016_Nagaoka_B_Team/code/SerialMultiByte/#7f87c3ff29ef
diff -r 9332620c08c6 -r f4a6cc918833 main.cpp --- a/main.cpp Tue Dec 18 19:00:19 2018 +0900 +++ b/main.cpp Tue Sep 03 05:37:17 2019 +0000 @@ -1,30 +1,16 @@ #include "mbed.h" #include "measuring_wheel.h" +#include "pin_config.h" -Serial pc(USBTX, USBRX, 115200); -MeasuringWheel measuring(PA_9, PA_8, PA_0, PA_1, PB_7, PB_6); -// MeasuringWheel measuring(PB_6,PB_7,PA_8,PA_9,PA_6,PA_7); +Serial pc(USBTX,USBRX, 115200); +//3,1,5 +MeasuringWheel measuring(PA_1,PA_0, PA_8, PA_9, PB_6,PB_7); +//1,3,4 +//MeasuringWheel measuring(PB_6, PB_7, PA_8, PA_9, PC_6, PC_7); +//MeasuringWheel measuring(encoder1_a, encoder1_b, encoder2_a, encoder2_b, encoder3_a, encoder3_b); int main() { - measuring.wheelDiameter(48, 48, 48); - while (true) { - // pc.printf("%d,%d,\n",(int)measuring.getOutX(),(int)measuring.getOutY()); - // pc.printf("w1 = %f, w2 = %f, w3 = - // %f\r\n",measuring.getWheel1(),measuring.getWheel2(),measuring.getWheel3()); - // pc.printf("yaw = %f\r\n",measuring.getjyroAngle()); - /// Thread::wait(100); - // measuring.debugLed[1]->write(!measuring.debugLed[1]->read()); - if (abs((int)measuring.getjyroAngle()) % 6 > 3) { - measuring.debugLed[1]->write(true); - } else { - measuring.debugLed[1]->write(false); + while (true) { + pc.printf("x = %f, y = %f, theta = %f\r\n", measuring.getOutX(), measuring.getOutY(), measuring.getjyroAngle()); } - if (abs((int)measuring.getOutX()) % 6 > 3) { - measuring.debugLed[2]->write(true); - } else { - measuring.debugLed[2]->write(false); - } - // kwait(fabs(measuring.getjyroAngle()) / 1.0); - wait(0.1); - } }
diff -r 9332620c08c6 -r f4a6cc918833 measuring_wheel.lib --- a/measuring_wheel.lib Tue Dec 18 19:00:19 2018 +0900 +++ b/measuring_wheel.lib Tue Sep 03 05:37:17 2019 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/teams/NHK-Robocon2016_Nagaoka_B_Team/code/measuring_wheel/#d4dba3255f35 +https://os.mbed.com/users/ec30109b/code/measuring_wheel/#8ea251946b2a
diff -r 9332620c08c6 -r f4a6cc918833 pin_config.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pin_config.h Tue Sep 03 05:37:17 2019 +0000 @@ -0,0 +1,15 @@ +#ifndef PIN_CONFIG_H +#define PIN_CONFIG_H + +const PinName mainTX = PC_12; +const PinName mainRX = PD_2; +const PinName R1370TX = PC_10; +const PinName R1370RX = PC_11; +const PinName encoder1_a = PA_0; +const PinName encoder1_b = PA_1; +const PinName encoder2_a = PA_8; +const PinName encoder2_b = PA_9; +const PinName encoder3_a = PB_6; +const PinName encoder3_b = PB_7; + +#endif \ No newline at end of file