In this project we will use a PIR sensor to detect motion.
When the PIR sensor detects movement it will trigger an interrupt that in turn will tell the BleuIO Dongle to advertise for 25 seconds. Just so the PIR Sensor will not trigger constantly we have put a 20 second timeout before it will trigger again. If no new interrupts have been detected after the 25 second advertising timer has run out the BleuIO Dongle will stop advertising and wait for a new interrupt to happen. The yellow LED on the STM32 board also toggles if there is a movement.