タコ 駆動側
Dependencies: 2017NHKpin_config FEP R1307 PID ikarashiMDC omni_wheel
Fork of NHK2017_octopus2 by
Diff: bot/bot.cpp
- Revision:
- 14:1fadf7d2f583
- Parent:
- 11:a8385ca0a275
- Child:
- 15:9aa11febe517
--- a/bot/bot.cpp Thu Sep 07 20:17:26 2017 +0900 +++ b/bot/bot.cpp Tue Sep 12 10:21:00 2017 +0900 @@ -14,8 +14,7 @@ ikarashiMDC({&RS485Controller, 1, 3, SM, &RS485}) }), receiveSuccessed(0), - led({DebugLED1, DebugLED2, DebugLED3, DebugLED4, - DebugLED5, DebugLED6, DebugLED7, DebugLED8}), + led({DebugLED3, DebugLED4, DebugLED5}), debugSerial(USBTX, USBRX, 115200) { for(int i = 0; i < 3; i++) { @@ -25,22 +24,17 @@ quadOmni.moveXY(0, 0, 0); powerSwitch = 1; - - for(int i = 0; i < 8; i++) { - led[i] = 1; + for(int i = 0; i < 3; i++) { + led[i] = true; wait(0.1); - led[i] = 0; - } - for(int i = 0; i < 8; i++) { - led[i] = 1; - wait(0.1); - led[i] = 0; + led[i] = false; } } void Bot::confirmAll() { receiveSuccessed = pad.receiveState(); + led[0] = receiveSuccessed; if(!receiveSuccessed) { quadOmni.moveXY(0, 0, 0); slider.slide(0); @@ -53,6 +47,7 @@ void Bot::controllDrive() { if(receiveSuccessed) { + led[1] = !led[1]; if(pad.getNorm(1) > 0.5) { PIDC::PID::setSetPoint((pad.getRadian(1) - M_PI / 2) * (180.0 / M_PI)); PIDC::confirm(); @@ -91,6 +86,7 @@ } if(receiveSuccessed) { + led[1] = !led[1]; quadOmni.moveCircular( pad.getNorm(0) / 2.0, pad.getRadian(0) - PIDC::planeCurrentDegree / 10.0 * (M_PI / 180.0) + M_PI,