Gabriel Karerangabo / Mbed 2 deprecated Blink_SwitchButton

Dependencies:   mbed

Blinking2Ledswith_SwitchButton.cpp

Committer:
kgabriel
Date:
2021-06-04
Revision:
1:f2ac268b3b17
Parent:
0:f792b1ecc7b3

File content as of revision 1:f2ac268b3b17:

#include "mbed.h"

DigitalOut redLed(p5);
DigitalOut yellowLed(p7);
DigitalIn switchButton(p6);

int main() {
  
    while (1) {
        if(switchButton==1){
            redLed=1;
            yellowLed=0;
        }
        else{
            redLed=0;
            yellowLed=1;
        }
        
        wait(1);
    }
}