![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
This is the application of d.c motor as a hand dryer .
Revision 0:5d05007d486e, committed 2016-05-07
- 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 |
diff -r 000000000000 -r 5d05007d486e main.cpp --- /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;} + } + } +}
diff -r 000000000000 -r 5d05007d486e mbed.bld --- /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