digital input example of CORE-1000
Dependencies: mbed
Revision 1:4a3198da4fe1, committed 2017-02-03
- Comitter:
- odb
- Date:
- Fri Feb 03 08:04:04 2017 +0000
- Parent:
- 0:802145a6ea33
- Commit message:
- CORE-1000 First
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 802145a6ea33 -r 4a3198da4fe1 main.cpp --- 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; } }
diff -r 802145a6ea33 -r 4a3198da4fe1 mbed.bld --- a/mbed.bld Thu Sep 26 14:35:38 2013 +0000 +++ b/mbed.bld Fri Feb 03 08:04:04 2017 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/082adc85693f \ No newline at end of file