shota koishi / Mbed 2 deprecated drive2

Dependencies:   mbed

Committer:
smallstone
Date:
Sun Nov 10 10:22:43 2019 +0000
Revision:
1:293b11fbc576
Parent:
0:1b294da0842e
Child:
2:ea39c24e77b2
kovjj

Who changed what in which revision?

UserRevisionLine numberNew contents of line
smallstone 0:1b294da0842e 1 #include "mbed.h"
smallstone 1:293b11fbc576 2 #include "TB6612.h"
smallstone 0:1b294da0842e 3
smallstone 1:293b11fbc576 4 TB6612 motor1(p24,p29,p30); //pwma,AIN1,AIN2,can brake//
smallstone 1:293b11fbc576 5 TB6612 motor2(p23,p28,p27); //pwmb,BIN1,BIN2,can brake//
smallstone 0:1b294da0842e 6
smallstone 0:1b294da0842e 7 int main() {
smallstone 1:293b11fbc576 8 motor1=100; //移動最初1000㎜直進
smallstone 1:293b11fbc576 9 motor2=100;
smallstone 1:293b11fbc576 10 wait(6);
smallstone 1:293b11fbc576 11 motor1=100;
smallstone 1:293b11fbc576 12 motor2=100;
smallstone 0:1b294da0842e 13 //nichrome2();
smallstone 0:1b294da0842e 14 //drill_spinner();
smallstone 0:1b294da0842e 15 //seed_spinner();
smallstone 0:1b294da0842e 16 //splash();
smallstone 1:293b11fbc576 17 motor1=100; //200mm直進する
smallstone 1:293b11fbc576 18 motor2=100;
smallstone 1:293b11fbc576 19 wait(12);
smallstone 1:293b11fbc576 20 motor1=0;
smallstone 1:293b11fbc576 21 motor2=0; //耕し終了
smallstone 0:1b294da0842e 22 //nichrome3();
smallstone 1:293b11fbc576 23 motor1=50; //100mm直進する
smallstone 1:293b11fbc576 24 motor2=50;
smallstone 1:293b11fbc576 25 wait(6);
smallstone 1:293b11fbc576 26 motor1=50; //90°左旋回
smallstone 1:293b11fbc576 27 motor2=0;
smallstone 1:293b11fbc576 28 wait(2);
smallstone 1:293b11fbc576 29 motor1=50; //200mm直進する
smallstone 1:293b11fbc576 30 motor2=50;
smallstone 1:293b11fbc576 31 wait(12);
smallstone 1:293b11fbc576 32 motor1=50; //90°左旋回
smallstone 1:293b11fbc576 33 motor2=0;
smallstone 1:293b11fbc576 34 wait(2);
smallstone 1:293b11fbc576 35 motor1=50; //300mm直進する
smallstone 1:293b11fbc576 36 motor2=50;
smallstone 1:293b11fbc576 37 wait(18);
smallstone 1:293b11fbc576 38 motor1=50; //90°左旋回
smallstone 1:293b11fbc576 39 motor2=0;
smallstone 0:1b294da0842e 40 //camera on
smallstone 0:1b294da0842e 41
smallstone 0:1b294da0842e 42
smallstone 0:1b294da0842e 43
smallstone 0:1b294da0842e 44 }