oppgave 4 el-pom H15

Dependencies:   mbed

main.cpp

Committer:
madmonkeyman82
Date:
2016-02-20
Revision:
0:680d846a6f2f

File content as of revision 0:680d846a6f2f:

#include "mbed.h"

DigitalOut Led1(PA_8);
DigitalOut Motor(PC_7);
DigitalIn S1(PB_5);



int main() {
    // Init the ticker with the address of the function (toggle_led) to be attached and the interval (100 ms)
    S1.mode(PullUp);
    Led1 = 0;
    Motor = 0;
    while (true) {
        
        if(S1==0)
        {
        Led1=1;
        Motor=1;    
        }
        else 
        {
        Led1=0;
        Motor=0;    
        }
        // Do other things...
    }
}