Alex Wood
/
PIR_motion_HelloWorld
Simple HelloWorld example program for PIR motion sensor.
Revision 0:61201dd6e178, committed 2015-03-05
- Comitter:
- awood37
- Date:
- Thu Mar 05 23:08:46 2015 +0000
- Commit message:
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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Mar 05 23:08:46 2015 +0000 @@ -0,0 +1,17 @@ +#include "mbed.h" + +DigitalOut led1(LED1); +DigitalIn alarm(p29, PullUp); //internal pull up + +int main() { + wait(2); //Wait for sensor to take snap shot of still room + + while(1) { + if (!alarm){ + led1=1; + wait(2); + } + else + led1=0; + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Mar 05 23:08:46 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/7e07b6fb45cf \ No newline at end of file