DigitalIn Hello World

Dependencies:   mbed

mbed 2 and mbed OS 5

This is an mbed 2 example. For an mbed-os example, please see:

Import programDigitalIn_HelloWorld

DigitalIn Hello World

main.cpp

Committer:
mbed_official
Date:
2013-02-21
Revision:
1:2cf612e040e0
Parent:
0:aaf5a9d465fd

File content as of revision 1:2cf612e040e0:

#include "mbed.h"
 
DigitalIn enable(p5);
DigitalOut led(LED1);
 
int main() {
    while(1) {
        if(enable) {
            led = !led;
        }
        wait(0.25);
    }
}