
Seeedstudio Arch Examples : GPIO - BusOut example
Fork of Arch_GPIO_Ex3 by
main.cpp@3:a72374052938, 2013-09-16 (annotated)
- 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?
User | Revision | Line number | New 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 | } |