DigitalIn Hello World

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 enable(p5);
00004 DigitalOut led(LED1);
00005  
00006 int main() {
00007     while(1) {
00008         if(enable) {
00009             led = !led;
00010         }
00011         wait(0.25);
00012     }
00013 }