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.
main.cpp
00001 #include "mbed.h" 00002 Serial pc(USBTX, USBRX); // tx, rx 00003 DigitalOut led(LED1); 00004 DigitalIn pir(D2); //Connect it to 00005 Timer timer; 00006 00007 int main() 00008 { 00009 while(1) { 00010 if(!pir){ 00011 led = 0; 00012 pc.printf("Nothing Detected\r\n"); 00013 wait(1); 00014 } 00015 else { 00016 led=1; 00017 pc.printf("Motion Detected\r\n"); 00018 wait(1); 00019 } 00020 } 00021 }
Generated on Tue Jul 19 2022 17:16:16 by
1.7.2