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.
Fork of frdm_Grove_PIR_Example by
main.cpp
- Committer:
- GregC
- Date:
- 2015-12-31
- Revision:
- 0:d444f103013a
- Child:
- 1:5c2fc62b9c0a
File content as of revision 0:d444f103013a:
#include "mbed.h" InterruptIn motion(D2); int motion_detected = 0; void irq_handler(void) { motion_detected = 1; } int main(void) { int cnt = 0; motion.rise(&irq_handler); while(1) { if(motion_detected) { cnt++; motion_detected = 0; printf("Hello! I've detected %d times since reset\n", cnt); } } }