Program for Board1 Black button

Dependencies:   mbed

Fork of Board1Prg1 by IIOT Lecturers

main.cpp

Committer:
selvakumararm
Date:
2018-03-28
Revision:
0:af784625c6c0

File content as of revision 0:af784625c6c0:

#include "mbed.h"

DigitalOut myled(LED1);
DigitalIn button1(USER_BUTTON);

int main() {
    while(1) {
        if(button1 ==1){
        myled = 1; // LED is ON
        wait(1.0); // 1 sec
        myled = 0; // LED is OFF
        wait(1.0); // 1 sec
    }
    else{
        myled = 0;
}
}}