-

Dependencies:   mbed

Teste2.cpp

Committer:
NathanLederman
Date:
2018-04-18
Revision:
1:24f21be80e14

File content as of revision 1:24f21be80e14:

#include "mbed.h"
 
DigitalIn mybutton(USER_BUTTON);
DigitalIn habilita(PA_6);
DigitalOut myled(LED1);
DigitalOut enable (PB_6);
DigitalOut dir(PB_9);
DigitalOut step(PB_8);
//int lista[4][4] ={{0,0,0,1},{0,0,1,0},{0,1,0,0},{1,0,0,0}}
//int listainv[4][4] ={{1,0,0,0},{0,1,0,0},{0,0,1,0},{0,0,0,1}}


int main () {
enable = 0;
    
    while(1) {
        if (mybutton == 0) { // botão usuário pressionado
            dir = !dir;
        }
        step = 0;
        wait(0.01);
        step = 1;
        wait(0.01);
        
        if (habilita == 0) { // botão externo pressionado
            enable = !enable;
        }
//myled = !myled;
//step = !step;  
//wait(0.01);
    }
}