Lace Dynamics / Mbed 2 deprecated motor_driver_initial

Dependencies:   DebounceIn mbed

main.cpp

Committer:
figlax
Date:
2015-05-26
Revision:
0:f9546c3e2e72
Child:
1:357e2c6d4e66

File content as of revision 0:f9546c3e2e72:

#include "mbed.h"

DigitalOut myled(LED1); //Indicator light to indicate the program is running
DigitalOut motor(D4); //To MOSFET
DigitalOut indic(LED2); //Indicate Hall ES State
DigitalIn hall(D6); //HFS (deprecated?)
DigitalIn swiRe(D1); //Rear Limit Switch
DigitalIn swiFr(D2); //Front Limit Switch

int main() {
    myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
        myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
        myled = 1;
    while(1) {
        if (swiRe&&(~swiFr)){
            motor = 1;
            indic = 1;
            }
            
        if((~swiRe)&&swiFr){
            motor = 0;
            indic = 0;
            }
        //if (hall==1){
        //    motor = 1;
        //    indic = 1;
        //    }
        //if (hall == 0) {
        //    motor= 0;
        //    indic = 0;
        //    }
         
                   
        
    
    }
}