Code: Select all
def touchState(touchPin):
try: #Try getting Touch state
ts = touchPin.read()
except: #If error, return True
return True
if ts < 400: #If touchpad value is under 400, return true
return True
elif ts > 400:#If touchpad value is over 400, return false
return False
else: #if everything is false just return false
return False
Another thing that I'm noticing is that I only get the error if the board has been running for a while, If I haven't turned it on for a couple of minutes and then turn it on again, everything will work just fine without errors for maybe 1-2 minutes after that I will start getting the Touchpad Error again, and will only stop if I unplug the board for a while.
Has anyone else experienced this error? Are there any fix for this? Is it hardware related or software related?