Luca Mottola / Mbed 2 deprecated AthensFall19-DISCO-ButtonBusy

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 DigitalIn button(USER_BUTTON); // Change to match your board
00004 DigitalOut led(LED1);
00005 
00006 #define BUTTON_PRESS 0
00007 
00008 int main() {
00009     while(1) {
00010         if(BUTTON_PRESS == button){
00011            led = !led;
00012            wait(1);
00013        }
00014     }
00015 }