digital input example of CORE-1000
Dependencies: mbed
Diff: main.cpp
- Revision:
- 1:4a3198da4fe1
- Parent:
- 0:802145a6ea33
--- a/main.cpp Thu Sep 26 14:35:38 2013 +0000 +++ b/main.cpp Fri Feb 03 08:04:04 2017 +0000 @@ -1,13 +1,16 @@ #include "mbed.h" -DigitalOut myled(LED1); -DigitalIn boton(D2); +DigitalOut myled(PC_9); +DigitalIn Sensor_DIN(PA_6); int main() { + printf("\n Sensor Digital InPut example\n"); while(1) { - if (boton == 0){ + if (Sensor_DIN == 0){ myled = 1; - }else{ + printf("sensor detected \n\r"); + } + else{ myled = 0; } }