shota koishi / Mbed 2 deprecated drive2

Dependencies:   mbed

Committer:
smallstone
Date:
Sat Oct 26 15:03:17 2019 +0000
Revision:
0:1b294da0842e
Child:
1:293b11fbc576
sxsacck

Who changed what in which revision?

UserRevisionLine numberNew contents of line
smallstone 0:1b294da0842e 1 #include "mbed.h"
smallstone 0:1b294da0842e 2 #include "moterdriver.h"
smallstone 0:1b294da0842e 3
smallstone 0:1b294da0842e 4 Moter moter1(p24,p29,p30,1); //pwma,AIN1,AIN2,can brake//
smallstone 0:1b294da0842e 5 Moter moter2(p23,p28,p27,1); //pwmb,BIN1,BIN2,can brake//
smallstone 0:1b294da0842e 6
smallstone 0:1b294da0842e 7 int main() {
smallstone 0:1b294da0842e 8 moter1.speed(1); //移動最初1000㎜直進
smallstone 0:1b294da0842e 9 moter2.speed(1);
smallstone 0:1b294da0842e 10 wait(600);
smallstone 0:1b294da0842e 11 moter1.speed(0);
smallstone 0:1b294da0842e 12 moter2.speed(0);
smallstone 0:1b294da0842e 13 //nichrome2();
smallstone 0:1b294da0842e 14 //drill_spinner();
smallstone 0:1b294da0842e 15 //seed_spinner();
smallstone 0:1b294da0842e 16 //splash();
smallstone 0:1b294da0842e 17 moter1.speed(1); //200mm直進する
smallstone 0:1b294da0842e 18 moter2.speed(1);
smallstone 0:1b294da0842e 19 wait(120);
smallstone 0:1b294da0842e 20 moter1.speed(0);
smallstone 0:1b294da0842e 21 moter2.speed(0); //耕し終了
smallstone 0:1b294da0842e 22 //nichrome3();
smallstone 0:1b294da0842e 23 moter1.speed(1); //100mm直進する
smallstone 0:1b294da0842e 24 moter2.speed(1);
smallstone 0:1b294da0842e 25 wait(60);
smallstone 0:1b294da0842e 26 moter1.speed(1); //90°左旋回
smallstone 0:1b294da0842e 27 moter2.speed(-1);
smallstone 0:1b294da0842e 28 wait(20);
smallstone 0:1b294da0842e 29 moter1.speed(1); //200mm直進する
smallstone 0:1b294da0842e 30 moter2.speed(1);
smallstone 0:1b294da0842e 31 wait(120);
smallstone 0:1b294da0842e 32 moter1.speed(1); //90°左旋回
smallstone 0:1b294da0842e 33 moter2.speed(-1);
smallstone 0:1b294da0842e 34 wait(20);
smallstone 0:1b294da0842e 35 moter1.speed(1); //300mm直進する
smallstone 0:1b294da0842e 36 moter2.speed(1);
smallstone 0:1b294da0842e 37 wait(180);
smallstone 0:1b294da0842e 38 moter1.speed(1); //90°左旋回
smallstone 0:1b294da0842e 39 moter2.speed(-1);
smallstone 0:1b294da0842e 40 //camera on
smallstone 0:1b294da0842e 41
smallstone 0:1b294da0842e 42
smallstone 0:1b294da0842e 43
smallstone 0:1b294da0842e 44 }
smallstone 0:1b294da0842e 45 //気球試験の流れ
smallstone 0:1b294da0842e 46
smallstone 0:1b294da0842e 47
smallstone 0:1b294da0842e 48 準備5分+打ち上げ5分+落下1分=11分
smallstone 0:1b294da0842e 49 (準備時間とは電源を入れてから気球に搭載するまでにかかる時間のこと)
smallstone 0:1b294da0842e 50 着地判定 13分後(余裕をもって)
smallstone 0:1b294da0842e 51 パラシュート切り離し
smallstone 0:1b294da0842e 52 移動最初1000㎜直進
smallstone 0:1b294da0842e 53 開始地点のコーンを切り離す
smallstone 0:1b294da0842e 54 耕し、種をまき、土をかぶせ、水をまき200㎜進む
smallstone 0:1b294da0842e 55  ドリルモータ ON
smallstone 0:1b294da0842e 56  種まき・水まきサーボモータ ON
smallstone 0:1b294da0842e 57 終了地点のコーンを切り離す
smallstone 0:1b294da0842e 58 100㎜直進
smallstone 0:1b294da0842e 59 90°左旋回
smallstone 0:1b294da0842e 60 200㎜直進
smallstone 0:1b294da0842e 61 90°左旋回
smallstone 0:1b294da0842e 62 300㎜直進
smallstone 0:1b294da0842e 63 90°旋回
smallstone 0:1b294da0842e 64 カメラON→画像通信開始
smallstone 0:1b294da0842e 65 カメラの映像送信→人間がPCで確認しコーンが見えなければ10㎝後退
smallstone 0:1b294da0842e 66 ボタン操作などで後退させるようにする
smallstone 0:1b294da0842e 67 (見えるまで繰り返す)
smallstone 0:1b294da0842e 68 確認出来たら終了
smallstone 0:1b294da0842e 69
smallstone 0:1b294da0842e 70
smallstone 0:1b294da0842e 71
smallstone 0:1b294da0842e 72 手動用プログラムはシステムが動かなかったと起用の補助システムとして搭載したい//
smallstone 0:1b294da0842e 73
smallstone 0:1b294da0842e 74