Scott Jeong
/
PIR_Motion_Sensor_WIZwiki-W7500
Use to WIZwiki-W7500, Sensing to PIR motion sensor module(HC-SR501)
Revision 0:9ea50fe6902c, committed 2015-06-29
- Comitter:
- nanjsk
- Date:
- Mon Jun 29 05:52:26 2015 +0000
- Commit message:
- Use to WIZwiki-W7500, Sensing to PIR sensor module(HC-SR501)
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 000000000000 -r 9ea50fe6902c main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Jun 29 05:52:26 2015 +0000 @@ -0,0 +1,21 @@ +// PIR Motion Sensor Modlue : HC-SR501 +#include "mbed.h" + +DigitalOut myled(LED1); +DigitalIn PIR(D8); + +Serial pc(USBTX, USBRX); + +int main() { + pc.baud(115200); + wait(0.5f); + pc.printf("Hello WizWIki-W7500!\n\r"); + pc.printf("===========================================\n\r"); + int PIR_sensor; + while(1) { + PIR_sensor = PIR; + pc.printf("PIR Value : %d\r\n",PIR_sensor); + myled =! PIR_sensor; + wait(0.1f); + } +} \ No newline at end of file
diff -r 000000000000 -r 9ea50fe6902c mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Jun 29 05:52:26 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/7cff1c4259d7 \ No newline at end of file