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.
Dependencies: mbed Motordriver DHT
Revision 0:c8b31227d874, committed 2019-02-26
- Comitter:
- Niranjan_ravi
- Date:
- Tue Feb 26 18:40:51 2019 +0000
- Child:
- 1:b63b3fcf72d1
- Commit message:
- proximity sensor
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 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Feb 26 18:40:51 2019 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/mbed/builds/675da3299148 \ No newline at end of file