motor running

Dependencies:   mbed

Committer:
chetanpatil
Date:
Wed Nov 25 11:17:36 2015 +0000
Revision:
0:9f382047c8bd
motor

Who changed what in which revision?

UserRevisionLine numberNew contents of line
chetanpatil 0:9f382047c8bd 1 #include "mbed.h"
chetanpatil 0:9f382047c8bd 2 BusOut e(p13.p14);
chetanpatil 0:9f382047c8bd 3 BusOut s1(p8);
chetanpatil 0:9f382047c8bd 4 BusOut s2(p9);
chetanpatil 0:9f382047c8bd 5 //BusIn w(p5,p6);
chetanpatil 0:9f382047c8bd 6
chetanpatil 0:9f382047c8bd 7 int main()
chetanpatil 0:9f382047c8bd 8 {
chetanpatil 0:9f382047c8bd 9
chetanpatil 0:9f382047c8bd 10 while(1)
chetanpatil 0:9f382047c8bd 11 {
chetanpatil 0:9f382047c8bd 12 e=1;
chetanpatil 0:9f382047c8bd 13 s1=1;
chetanpatil 0:9f382047c8bd 14 s2=2;
chetanpatil 0:9f382047c8bd 15 wait(1);
chetanpatil 0:9f382047c8bd 16
chetanpatil 0:9f382047c8bd 17 /*if(w==0)
chetanpatil 0:9f382047c8bd 18 {
chetanpatil 0:9f382047c8bd 19 e=1;
chetanpatil 0:9f382047c8bd 20 s1=0;
chetanpatil 0:9f382047c8bd 21 wait(0.030);
chetanpatil 0:9f382047c8bd 22 s2=0;
chetanpatil 0:9f382047c8bd 23 wait(0.030);
chetanpatil 0:9f382047c8bd 24
chetanpatil 0:9f382047c8bd 25 }
chetanpatil 0:9f382047c8bd 26 if(w==1)
chetanpatil 0:9f382047c8bd 27 {
chetanpatil 0:9f382047c8bd 28 e=1;
chetanpatil 0:9f382047c8bd 29 s1=1;
chetanpatil 0:9f382047c8bd 30 wait(0.020);
chetanpatil 0:9f382047c8bd 31 s2=0;
chetanpatil 0:9f382047c8bd 32 wait(0.020);
chetanpatil 0:9f382047c8bd 33
chetanpatil 0:9f382047c8bd 34 }
chetanpatil 0:9f382047c8bd 35 if(w==2)
chetanpatil 0:9f382047c8bd 36 {
chetanpatil 0:9f382047c8bd 37 e=1;
chetanpatil 0:9f382047c8bd 38 s1=1;
chetanpatil 0:9f382047c8bd 39 wait(0.5);
chetanpatil 0:9f382047c8bd 40 s2=0;
chetanpatil 0:9f382047c8bd 41 wait(0.5);
chetanpatil 0:9f382047c8bd 42
chetanpatil 0:9f382047c8bd 43 }
chetanpatil 0:9f382047c8bd 44 if(w==3)
chetanpatil 0:9f382047c8bd 45 {
chetanpatil 0:9f382047c8bd 46 e=1;
chetanpatil 0:9f382047c8bd 47 s1=1;
chetanpatil 0:9f382047c8bd 48 wait(1);
chetanpatil 0:9f382047c8bd 49 s2=0;
chetanpatil 0:9f382047c8bd 50 wait(1);
chetanpatil 0:9f382047c8bd 51 }
chetanpatil 0:9f382047c8bd 52 else
chetanpatil 0:9f382047c8bd 53 {
chetanpatil 0:9f382047c8bd 54 e=1;
chetanpatil 0:9f382047c8bd 55 s1=1;
chetanpatil 0:9f382047c8bd 56 wait(0.03);
chetanpatil 0:9f382047c8bd 57 s1=0;
chetanpatil 0:9f382047c8bd 58 wait(0.03);
chetanpatil 0:9f382047c8bd 59 }*/
chetanpatil 0:9f382047c8bd 60 }
chetanpatil 0:9f382047c8bd 61 }