This is the application of d.c motor as a hand dryer .

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Akshayiupui
Date:
Sat May 07 01:03:18 2016 +0000
Commit message:
d.c motor application as a hand dryer

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat May 07 01:03:18 2016 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+InterruptIn motion(PTB9);
+DigitalOut vcc(PTC16);
+int motion_detected = 0;
+int l=1;
+void irq_handler(void)
+{   
+    motion_detected = 1;
+}
+    
+int main(void)
+{  
+    motion.rise(&irq_handler);
+   
+    while(1) {
+           if(motion_detected==1){ 
+       motion_detected = 0;
+        l++;
+           if(l==3){printf("Motor is working\n");
+               vcc=!vcc;}
+           if(l==6){vcc=0;
+           l=0;}
+           }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat May 07 01:03:18 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/aae6fcc7d9bb
\ No newline at end of file