Pablo's TEAM LAB2 / Mbed 2 deprecated LAB2

Dependencies:   mbed

main.cpp

Committer:
m210198
Date:
2018-09-20
Revision:
0:db1b39babf83
Child:
1:1fb5ff2554ca

File content as of revision 0:db1b39babf83:

#include "mbed.h"
int main() {
DigitalOut tony[5]={p26,p27,p28,p29,p30};
 tony[p26]=0;
 tony[p27]=0;
 tony[p28]=1;
 tony[p29]=0;
 tony[p30]=0;
 int x;
 Digital sw1( 
     while(1) {
        if(sw1== 1 && sw2==1){
        tony[x]=0;
        x=2;
        tony[x]=1;
        }
        
        else if (sw1==1){
        tony[x]=0;
        if(x=4);
        x++;}
        tony[x]=1;
        wait(0.5);
        }
        else if (sw2==1){
        tony[x]=0;
        if(x=0);
        x--;}
        tony[x]=1;
        wait(0.5);
        }
    }
}