Junichi Katsu
/
Grove_TouchSensor
GROVE - タッチセンサ サンプルプログラム
Diff: main.cpp
- Revision:
- 0:50b5cc4932cd
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Nov 29 07:40:41 2013 +0000 @@ -0,0 +1,15 @@ +#include "mbed.h" + +DigitalOut myled(LED1); +DigitalIn TouchSensor(p5); + +int main() { + while(1) { + if(TouchSensor==1){ + myled = 1; + } else { + myled = 0; + } + wait(0.2); + } +}