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: mbed
Fork of circle_war_ver_A_NUCLEO_ by
main.cpp@11:f8fac9693cd5, 2016-04-04 (annotated)
- Committer:
- username16248
- Date:
- Mon Apr 04 08:55:04 2016 +0000
- Revision:
- 11:f8fac9693cd5
- Parent:
- 10:369a9389bb7e
- Child:
- 14:3403ce49a37a
?????.h???????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
baba2357 | 1:86d25c1c4bd5 | 1 | #include "mbed.h" |
baba2357 | 1:86d25c1c4bd5 | 2 | #include "pin_file.h" |
baba2357 | 1:86d25c1c4bd5 | 3 | #include "spi_nucleo.h" |
baba2357 | 1:86d25c1c4bd5 | 4 | #include "transfer.h" |
baba2357 | 2:bed6b204e64c | 5 | #include <string.h> |
baba2357 | 2:bed6b204e64c | 6 | |
baba2357 | 1:86d25c1c4bd5 | 7 | int main(){ |
baba2357 | 3:6ab4e8e3aa02 | 8 | spiInit(); |
baba2357 | 8:554e3d643b2d | 9 | push.mode(PullUp); |
baba2357 | 3:6ab4e8e3aa02 | 10 | while(pushed_number==0){ //手動 |
baba2357 | 8:554e3d643b2d | 11 | transfer(); |
baba2357 | 3:6ab4e8e3aa02 | 12 | spi_mbed(); //コントローラーからの信号を読み取る |
baba2357 | 8:554e3d643b2d | 13 | Cilinder=cilinder; |
baba2357 | 3:6ab4e8e3aa02 | 14 | if(RR==1){ |
baba2357 | 3:6ab4e8e3aa02 | 15 | //右旋回の関数 |
baba2357 | 3:6ab4e8e3aa02 | 16 | } |
baba2357 | 3:6ab4e8e3aa02 | 17 | else if(LR==1){ |
baba2357 | 3:6ab4e8e3aa02 | 18 | //左旋回の関数 |
baba2357 | 3:6ab4e8e3aa02 | 19 | } |
baba2357 | 8:554e3d643b2d | 20 | else if(onoff==1){ |
baba2357 | 8:554e3d643b2d | 21 | if(updown==1) up=0.1;//上下機構上昇 |
baba2357 | 8:554e3d643b2d | 22 | else down=0.1;//上下機構下降 |
baba2357 | 8:554e3d643b2d | 23 | } |
baba2357 | 3:6ab4e8e3aa02 | 24 | else{ |
baba2357 | 3:6ab4e8e3aa02 | 25 | //読み取った値speed_X,speed_Yを速度制御にぶち込む |
baba2357 | 3:6ab4e8e3aa02 | 26 | } |
baba2357 | 1:86d25c1c4bd5 | 27 | } |
baba2357 | 3:6ab4e8e3aa02 | 28 | while(pushed_number==1){ //自動 |
baba2357 | 8:554e3d643b2d | 29 | transfer(); |
baba2357 | 3:6ab4e8e3aa02 | 30 | getGyro(); |
baba2357 | 3:6ab4e8e3aa02 | 31 | //自己位置 |
baba2357 | 3:6ab4e8e3aa02 | 32 | //エアシリンダー |
baba2357 | 1:86d25c1c4bd5 | 33 | } |
baba2357 | 1:86d25c1c4bd5 | 34 | |
baba2357 | 3:6ab4e8e3aa02 | 35 | } |
baba2357 | 1:86d25c1c4bd5 | 36 | |
username16248 | 11:f8fac9693cd5 | 37 |