I was able to get a light sensor turning on the light in our carport working with a Phidget 0/16/16 board from a Raspberry Pi a while ago.
Now I wanted to expand things, reinstalled the libraries to be up-to-date and suddenly things don't work! Very annoying!
All installation parts seem to have gone well.
Here is the start of my Python code, which has worked well for a year or so:
from Phidget22.Phidget import *
from Phidget22.Devices.DigitalOutput import *
from Phidget22.Devices.DigitalInput import *
from Phidget22.Devices.Log import *
from Phidget22.LogLevel import *
from threading import Timer
import time
PhidgetSerialNumber = 346483;
phOutput = [DigitalOutput() for i in range (0, 16)]
But now I suddenly can't connect to this Phidget and Thonny shows an error in line 10: Name 'DigitalOutput' is not defined. I don't understand what has happened and how to solve this!
I suddenly realized there was a semicolon at the end of one line there (habit from C++), so I thought I found the problem. Alas, removing it didn't help...
Finally I realized that if I do "sudo bash" and run "python MyScript.py", it works!
So somehow I am suddenly not running Thonny Python IDE as administrator anymore? I must have done so before, because when I first programmed this code, it worked. Do I have to give my user "pi" on this Raspberry some kind of permission to the Phidget libraries that has been lost in the update process?
Problem solved: I edited the shortcut for starting Thonny to have "sudo" first in the command line. But why this suddenly became necessary, I still don't understand!