motion sensor is used to detect the any object

Dependencies:   mbed

Fork of HelloWorld by Simon Ford

Files at this revision

API Documentation at this revision

Comitter:
sumanshavi
Date:
Thu Dec 01 10:45:55 2016 +0000
Parent:
2:e78cebb5a0d5
Commit message:
motion sensor

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
motionsensor.h Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Dec 01 10:39:34 2016 +0000
+++ b/main.cpp	Thu Dec 01 10:45:55 2016 +0000
@@ -9,7 +9,7 @@
     wait(2); //Wait for sensor to take snap shot of still room
     
     while(1) {
-        if (motion==0){
+        if (motion==1){
             buzzer=1;
             wait(2);
         }
--- a/motionsensor.h	Thu Dec 01 10:39:34 2016 +0000
+++ b/motionsensor.h	Thu Dec 01 10:45:55 2016 +0000
@@ -8,7 +8,7 @@
     wait(2); //Wait for sensor to take snap shot of still room
     
     while(1) {
-        if (motion==0){
+        if (motion==1){
             buzzer=1;
             wait(2);
         }