atbreuer11
Posts: 5
Joined: Thu Jan 23, 2014 12:50 am

Detecting Input From GPIO

Thu Jan 23, 2014 1:01 am

This may be a simple question, however i have looked for the answer for a while.

I am making a reed switch system that I need to be always on. I need to run a python file when the value of the input changes.

I want to avoid a constant loop in a single file if possible.

Ideally when the input is changed a file will be run. I am not sure where to write the code to do that or how to make it run another file.

Thanks In Advance

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: Detecting Input From GPIO

Thu Jan 23, 2014 9:19 am

Do searches for threads and callback functions with RPi.GPIO there are several on here and on places like RasPi.tv
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

atbreuer11
Posts: 5
Joined: Thu Jan 23, 2014 12:50 am

Re: Detecting Input From GPIO

Thu Jan 23, 2014 7:45 pm

Thanks, I will. I might use cron jobs to get the job done however.

Thanks for your relpy

Bazzer
Posts: 9
Joined: Sun Jan 05, 2014 11:13 am

Re: Detecting Input From GPIO

Fri Jan 24, 2014 6:58 am

As said above there's a bunch of great tutorials on raspi.tv

http://raspi.tv/2013/how-to-use-interru ... d-rpi-gpio

Just work ur way through the series ;)

User avatar
chrisryall
Posts: 155
Joined: Wed Nov 27, 2013 11:45 am
Location: Wirral UK
Contact: Website

Re: Detecting Input From GPIO

Fri Jan 24, 2014 8:57 am

What is an interu ? ;)

Return to “General discussion”