Just need help trying to write the code so that I can run it as a background process, one that would continuously run as we are going to use this as one of my mom's primary means of communication (She has a disease that has robbed her of her voice). The only way I could think of is to code is so that instead of using event detection, would code my own event detection using if statements trapped in a while loop.
Code: Select all
while(1):
if GPIO.input(buttonA)==GPIO.HIGH:
pushMsg('A')
sleep(.5)
if GPIO.input(buttonB)==GPIO.HIGH:
pushMsg('B')
sleep(.5)
if GPIO.input(buttonC)==GPIO.HIGH:
pushMsg('C')
sleep(.5)
if GPIO.input(buttonD)==GPIO.HIGH:
pushMsg('D')
sleep(.5)