I have been working on a piece of code that I got from another tutorial. The
code polls the GPIO pins on a Raspberry Pi. When it detects a switch being
flipped, it plays a corresponding audio file. My problem is, if the switch
remains flipped, the audio repeats again and again. What I would like
Thanks to everyone for the help. The code below seems to work. My question is
why does oldstates need to multiplied by 32? Does this mean that the code will
only work for 32 switches before I have to reset the Pi?
Code:
#!/usr/bin/env python
from time import sleep
import os
import RPi.GPIO as G
Thanks to all for the help. The code below seems to work. My question is why
does oldstates need to be multiplied by 32? Does this means the code will only
read 32 switch changes? That would be a problem.
Code:
#!/usr/bin/env python
from time import sleep
import os
import RPi.GPIO as GPIO
GPIO