![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
4/2にちゃんと動いたやつ
Dependencies: mbed SBDBT arrc_mbed
main.cpp@1:642ee25ea489, 2022-01-08 (annotated)
- Committer:
- guesta
- Date:
- Sat Jan 08 12:47:01 2022 +0000
- Revision:
- 1:642ee25ea489
- Parent:
- 0:d8faed605a5c
- Child:
- 3:e4b5563563af
second_commit;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
guesta | 0:d8faed605a5c | 1 | #include "mbed.h" |
guesta | 0:d8faed605a5c | 2 | #include "core.hpp" |
guesta | 0:d8faed605a5c | 3 | |
guesta | 0:d8faed605a5c | 4 | int main(){ |
guesta | 1:642ee25ea489 | 5 | Robot main_robot(46,25.4,322.5,259.75); |
guesta | 1:642ee25ea489 | 6 | ScrpSlave scrp(PC_12,PD_2 ,PH_1 ,0x0807f800); |
guesta | 1:642ee25ea489 | 7 | Core rbt(&main_robot,&scrp,OMNI4,0.02); |
guesta | 1:642ee25ea489 | 8 | |
guesta | 1:642ee25ea489 | 9 | //---------------初期設定--------------- |
guesta | 1:642ee25ea489 | 10 | //モータ |
guesta | 1:642ee25ea489 | 11 | rbt.addMOT(PB_14,PB_13,2048,0);//モータ0 |
guesta | 1:642ee25ea489 | 12 | rbt.addMOT(PB_7,PB_6,2048,1); //モータ1 |
guesta | 1:642ee25ea489 | 13 | rbt.addMOT(PB_9,PB_8,2048,2); //モータ2 |
guesta | 1:642ee25ea489 | 14 | rbt.addMOT(PA_11,PB_1,2048,3); //モータ3 |
guesta | 1:642ee25ea489 | 15 | //エンコーダ |
guesta | 1:642ee25ea489 | 16 | RBT.addENC(PC_4,PA_13,512,4,1); |
guesta | 1:642ee25ea489 | 17 | RBT.addENC(PA_14,PA_15,512,4,2); |
guesta | 1:642ee25ea489 | 18 | RBT.addENC(PC_2,PC_3,512,4,3); |
guesta | 1:642ee25ea489 | 19 | RBT.addENC(PC_10,PC_11,512,4,4); |
guesta | 1:642ee25ea489 | 20 | RBT.addENC(PA_7,PA_6,512,4,5); |
guesta | 1:642ee25ea489 | 21 | RBT.addENC(PA_9,PA_8,512,4,6); |
guesta | 1:642ee25ea489 | 22 | RBT.addENC(PC_1,PC_0,512,4,7); |
guesta | 1:642ee25ea489 | 23 | RBT.addENC(PC_5,PA_12,512,4,8); |
guesta | 1:642ee25ea489 | 24 | //変数 |
guesta | 1:642ee25ea489 | 25 | bool auto = true; |
guesta | 1:642ee25ea489 | 26 | //------------------------------ |
guesta | 1:642ee25ea489 | 27 | |
guesta | 1:642ee25ea489 | 28 | rbt.START(); |
guesta | 1:642ee25ea489 | 29 | RBT.setPosition(0.0,0.0,0.0); |
guesta | 1:642ee25ea489 | 30 | |
guesta | 1:642ee25ea489 | 31 | //---------------ループ--------------- |
guesta | 1:642ee25ea489 | 32 | while(true){ |
guesta | 1:642ee25ea489 | 33 | rbt.getStatus(); |
guesta | 1:642ee25ea489 | 34 | |
guesta | 1:642ee25ea489 | 35 | rbt.LOOP(); |
guesta | 1:642ee25ea489 | 36 | } |
guesta | 1:642ee25ea489 | 37 | |
guesta | 0:d8faed605a5c | 38 | } |