New to Phidgets - How to Detect Motion and run code using Python?

Supporting 2.7 and 3.2+
Post Reply
dbakathaillist
Fresh meat
Posts: 2
Joined: Tue Jul 02, 2024 8:35 pm
Contact:

New to Phidgets - How to Detect Motion and run code using Python?

Post by dbakathaillist »

Hello,

I am new to phidgets and would like to know if what I'm envisioning is possible. I would like to use the Motion Sensor connected to a VINT hub, which will connect to my Raspberry Pi. The goal is to make a python script that will play an mp3 in the background once motion has been detected. I am setting up a special event for when the person walks in, they will hear a song played as a special touch. Any examples, tips, or advice on how to accomplish this would be much appreciated.
LucasP
Phidgetly
Posts: 24
Joined: Fri Oct 07, 2016 4:47 pm
Contact:

Re: New to Phidgets - How to Detect Motion and run code using Python?

Post by LucasP »

This guide provides information about getting started with Python and the Raspberry Pi:
This project provides an example of playing a sound based on a Phidget event:
dbakathaillist
Fresh meat
Posts: 2
Joined: Tue Jul 02, 2024 8:35 pm
Contact:

Re: New to Phidgets - How to Detect Motion and run code using Python?

Post by dbakathaillist »

Hello, thank you for your response. But this doesn't really show me how to accomplish what I am trying to do for the motion sensor device. I have a MOT2002_0 motion sensor hooked up to a VINT hub going back to my raspberry pi.
jdecoux
Labview Developer
Posts: 180
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: New to Phidgets - How to Detect Motion and run code using Python?

Post by jdecoux »

You can find code samples to get you started in the Code Samples tab for the MOT2002. Simply select your Hub and Python from the drop-down menus. You can adjust the sensitivity of the motion sensor using the sensor type as outlined in the resulting sample.

https://www.phidgets.com/?prodid=710#Tab_Code_Samples

You should be able to put whatever code you use to play sound in the onSensorChange event
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest