# How to program motion sensor using python api

**URL:** <https://forums.pimoroni.com/t/how-to-program-motion-sensor-using-python-api/7825>\
**Category:** Flotilla\
**Created:** [May 30, 2018, 6:08am UTC](https://forums.pimoroni.com/t/how-to-program-motion-sensor-using-python-api/7825 "2018-05-30T06:08:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![awkward\_domzxc](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@awkward\_domzxc](https://forums.pimoroni.com/u/awkward_domzxc)\
**Post date:** [May 30, 2018, 6:08am UTC](https://forums.pimoroni.com/t/how-to-program-motion-sensor-using-python-api/7825/1 "2018-05-30T06:08:37Z")

</div>

I’m planning to build a rat / rodent catcher using my flotilla dock and my raspberry pi.  
When the rat go to my trap and sense by the motion sensor, the box door will close but I don’t know how to program it using python api.  
Please help me :)
