Page 1 of 1

Detecting Input From GPIO

Posted: Thu Jan 23, 2014 1:01 am
by atbreuer11
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

Re: Detecting Input From GPIO

Posted: Thu Jan 23, 2014 9:19 am
by techpaul
Do searches for threads and callback functions with RPi.GPIO there are several on here and on places like RasPi.tv

Re: Detecting Input From GPIO

Posted: Thu Jan 23, 2014 7:45 pm
by atbreuer11
Thanks, I will. I might use cron jobs to get the job done however.

Thanks for your relpy

Re: Detecting Input From GPIO

Posted: Fri Jan 24, 2014 6:58 am
by Bazzer
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 ;)

Re: Detecting Input From GPIO

Posted: Fri Jan 24, 2014 8:57 am
by chrisryall
What is an interu ? ;)