I'm using my Pi as a media center, and I wanted to install some basic hardware controls on the casing.
Now, from various tutorials I've gotten as far as this:
Code: Select all
#!/usr/bin/env python from time import sleep import os import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(23, GPIO.IN) while True: if ( GPIO.input(23) == False ): [do something] sleep(1);
Can it be done? Can you tell me how? Also, if it can be done, I'd like to run the script all the time, from startup. And I also use the GPIO to control a character LCD through lcdproc, can I use these things together, or do they conflict?