Seeedstudio Arch Examples : GPIO - DigitalIn example

Dependencies:   mbed

Fork of Arch_GPIO_Ex2 by Visweswara R

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 DigitalOut led(LED1);    // Configure LED1 pin as output
00004 DigitalIn button(P1_14); // Configure P1_14 pin as input
00005 
00006 int main()
00007 {
00008     while(1) {
00009         led.write(button.read());    /* read the state of input port pin P1_14 and write it to output port pin LED1*/
00010     }
00011 }