code sample for workshop

Dependencies:   mbed

main.cpp

Committer:
okano
Date:
2015-04-13
Revision:
0:228cf6908a24

File content as of revision 0:228cf6908a24:

#include "mbed.h"

DigitalOut  myled( LED1 );
DigitalIn   input( p5 );
Serial      ser( USBTX, USBRX );

int main() {
    input.mode( PullUp );
    
    while(1) {
        myled = !input;
        ser.printf( "switch is %s\r\n", input ? "OFF" : "ON" );
        wait( 0.5 );
    }
}