メインマイコンのプログラム
Dependencies: mbed SBDBT_for_2022gourobo arrc_mbed
Diff: main.cpp
- Revision:
- 1:642ee25ea489
- Parent:
- 0:d8faed605a5c
- Child:
- 3:e4b5563563af
diff -r d8faed605a5c -r 642ee25ea489 main.cpp --- a/main.cpp Wed Dec 22 08:52:15 2021 +0000 +++ b/main.cpp Sat Jan 08 12:47:01 2022 +0000 @@ -2,5 +2,37 @@ #include "core.hpp" int main(){ - Robot main_robot(); + Robot main_robot(46,25.4,322.5,259.75); + ScrpSlave scrp(PC_12,PD_2 ,PH_1 ,0x0807f800); + Core rbt(&main_robot,&scrp,OMNI4,0.02); + +//---------------初期設定--------------- + //モータ + rbt.addMOT(PB_14,PB_13,2048,0);//モータ0 + rbt.addMOT(PB_7,PB_6,2048,1); //モータ1 + rbt.addMOT(PB_9,PB_8,2048,2); //モータ2 + rbt.addMOT(PA_11,PB_1,2048,3); //モータ3 + //エンコーダ + RBT.addENC(PC_4,PA_13,512,4,1); + RBT.addENC(PA_14,PA_15,512,4,2); + RBT.addENC(PC_2,PC_3,512,4,3); + RBT.addENC(PC_10,PC_11,512,4,4); + RBT.addENC(PA_7,PA_6,512,4,5); + RBT.addENC(PA_9,PA_8,512,4,6); + RBT.addENC(PC_1,PC_0,512,4,7); + RBT.addENC(PC_5,PA_12,512,4,8); + //変数 + bool auto = true; +//------------------------------ + + rbt.START(); + RBT.setPosition(0.0,0.0,0.0); + +//---------------ループ--------------- + while(true){ + rbt.getStatus(); + + rbt.LOOP(); + } + } \ No newline at end of file