Akshay Kulkarni
/
frdm_hand_dryer
This is the application of d.c motor as a hand dryer .
Diff: main.cpp
- Revision:
- 0:5d05007d486e
--- /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;} + } + } +}