Auto Shut-off safety system for stove
Dependencies: mbed Motordriver DHT
Diff: main.cpp
- Revision:
- 0:c8b31227d874
- Child:
- 1:b63b3fcf72d1
diff -r 000000000000 -r c8b31227d874 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Feb 26 18:40:51 2019 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" +Serial pc(USBTX, USBRX); // tx, rx +DigitalOut led(LED1); +DigitalIn pir(D2); //Connect it to +Timer timer; + +int main() +{ + while(1) { + if(!pir){ + led = 0; + pc.printf("Nothing Detected\r\n"); + wait(1); + } + else { + led=1; + pc.printf("Motion Detected\r\n"); + wait(1); + } + } +} \ No newline at end of file