red/power 5v/39 white/gnd/1 signal/black/19 use MBED stand alone ONLY ok seems to take the LED a long time to turn off - why? http://bildr.org/2011/06/pir_arduino/
Diff: main.cpp
- Revision:
- 0:c3ab9adf1295
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Feb 19 04:54:12 2014 +0000 @@ -0,0 +1,28 @@ +#include "mbed.h" + +/* + * Test the motion sensor + */ + + +DigitalOut LED(LED1); +DigitalIn PIR(p19); + + +int main() { + + PIR.mode(PullUp); + LED = 0; + + while(1) { + //printf("PIR %d \r\n", (int)PIR); + if (!PIR){ + LED=1; + wait(1.0); + }else{ + LED=0; + } + + } +} +