Working PIR sensor

Dependencies:   mbed

main.cpp

Committer:
awood37
Date:
2015-03-05
Revision:
0:61201dd6e178
Child:
1:f6f524d2dc18

File content as of revision 0:61201dd6e178:

#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;
    }
}