![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Photo sensor test for the CORE-1000
Dependencies: mbed
Revision 1:4b2ef0bfff0a, committed 2017-02-03
- Comitter:
- odb
- Date:
- Fri Feb 03 07:58:14 2017 +0000
- Parent:
- 0:912303e63cbd
- 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 912303e63cbd -r 4b2ef0bfff0a main.cpp --- a/main.cpp Fri Feb 21 12:53:03 2014 +0000 +++ b/main.cpp Fri Feb 03 07:58:14 2017 +0000 @@ -1,23 +1,21 @@ #include "mbed.h" -InterruptIn mybutton(USER_BUTTON); +InterruptIn mybutton(PA_15); DigitalOut myled(LED1); +DigitalOut mybuzzer(PC_4); float delay = 1.0; // 1 sec void pressed() { - if (delay == 1.0) - delay = 0.2; // 200 ms - else - delay = 1.0; // 1 sec + mybuzzer = 1; + wait (0.5); + mybuzzer = 0; } int main() { - mybutton.fall(&pressed); + mybutton.rise(&pressed); while (1) { - myled = !myled; - wait(delay); } }
diff -r 912303e63cbd -r 4b2ef0bfff0a mbed.bld --- a/mbed.bld Fri Feb 21 12:53:03 2014 +0000 +++ b/mbed.bld Fri Feb 03 07:58:14 2017 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/ed8466a608b4 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/99a22ba036c9 \ No newline at end of file