Digital Output states

Dependencies:   mbed

main.cpp

Committer:
tpavle13
Date:
2015-05-08
Revision:
0:2ade85994f67

File content as of revision 0:2ade85994f67:

#include "mbed.h"
DigitalOut out1(p5);
DigitalIn sw1(p19);

int main() {
    sw1.mode(PullUp);
    while(1){
    if (sw1==1) {
        out1=1;
        wait(0.6);
        out1=0;
        wait(0.6);
        }
    if (sw1==0) {
        out1=1;
        wait(0.3);
        out1=0;
        wait(0.3);
        }
     } 
 }