Seeedstudio Arch Examples : GPIO - BusOut example

Dependencies:   mbed

Fork of Arch_GPIO_Ex3 by Visweswara R

Committer:
viswesr
Date:
Mon Sep 16 04:44:20 2013 +0000
Revision:
3:a72374052938
Parent:
2:d7639bb949d7
Child:
4:ba523da0d68a
DigitalIn() : First version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
viswesr 0:ed40790a022a 1 #include "mbed.h"
viswesr 0:ed40790a022a 2
viswesr 3:a72374052938 3 DigitalOut led(LED1); // Configure LED1 pin as output
viswesr 3:a72374052938 4 DigitalIn button(P1_14); // Configure P1_14 pin as input
viswesr 0:ed40790a022a 5
viswesr 0:ed40790a022a 6 int main()
viswesr 0:ed40790a022a 7 {
viswesr 0:ed40790a022a 8 while(1) {
viswesr 3:a72374052938 9 led.write(button.read()); /* read the state of input port pin P1_14 and write it to output port pin LED1*/
viswesr 0:ed40790a022a 10 }
viswesr 0:ed40790a022a 11 }