Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of HelloWorld by
Diff: main.cpp
- Revision:
- 2:e78cebb5a0d5
- Parent:
- 0:fb6bbc10ffa0
- Child:
- 3:085dbf0f0726
diff -r 03c191369089 -r e78cebb5a0d5 main.cpp
--- a/main.cpp Sun Jan 01 20:57:57 2012 +0000
+++ b/main.cpp Thu Dec 01 10:39:34 2016 +0000
@@ -1,12 +1,20 @@
+
#include "mbed.h"
+
+DigitalOut buzzer(p19);
-DigitalOut myled(LED1);
-
-int main() {
+DigitalIn motion(p29);
+ int main() {
+
+ wait(2); //Wait for sensor to take snap shot of still room
+
while(1) {
- myled = 1;
- wait(0.2);
- myled = 0;
- wait(0.2);
+ if (motion==0){
+ buzzer=1;
+ wait(2);
+ }
+ else
+ buzzer=0;
+
}
-}
+}
\ No newline at end of file
