Junichi Katsu
/
Grove_Botton
GROVE - ボタン サンプルプログラム
main.cpp@0:904589e1d71e, 2013-11-29 (annotated)
- Committer:
- jksoft
- Date:
- Fri Nov 29 07:17:36 2013 +0000
- Revision:
- 0:904589e1d71e
Rev1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 0:904589e1d71e | 1 | #include "mbed.h" |
jksoft | 0:904589e1d71e | 2 | |
jksoft | 0:904589e1d71e | 3 | DigitalOut myled(LED1); |
jksoft | 0:904589e1d71e | 4 | DigitalIn Sw(p5); |
jksoft | 0:904589e1d71e | 5 | |
jksoft | 0:904589e1d71e | 6 | int main() { |
jksoft | 0:904589e1d71e | 7 | while(1) { |
jksoft | 0:904589e1d71e | 8 | if(Sw==1){ |
jksoft | 0:904589e1d71e | 9 | myled = 1; |
jksoft | 0:904589e1d71e | 10 | } else { |
jksoft | 0:904589e1d71e | 11 | myled = 0; |
jksoft | 0:904589e1d71e | 12 | } |
jksoft | 0:904589e1d71e | 13 | wait(0.2); |
jksoft | 0:904589e1d71e | 14 | } |
jksoft | 0:904589e1d71e | 15 | } |