Testing Pushbutton states

Dependencies:   mbed

Fork of VJEZBA5Pavlek by Applied engineering Team

main.cpp

Committer:
tpavle13
Date:
2015-05-08
Revision:
0:a2f342ac8251

File content as of revision 0:a2f342ac8251:

#include "mbed.h"
DigitalIn sw1(p5);
DigitalOut out1(p10);
int i;
int main() {
    
      sw1.mode(PullUp);
      out1=0;
      while(1){
        if(sw1==0){ 
                  
            if(sw1==1){                
                i=i++;
                
                    if(i==3){
                        out1=1;           
                }
            }
        }
    }
 }