mparadis wrote:If it works with the C example, there must be something wrong with both python scripts. Can you post them so I can be sure what you're running?
I've basically started with a supplied example (which works on my PC):
<code>
from Phidget22.Phidget import *
from Phidget22.Devices.DigitalOutput import *
import time
#Declare any event handlers here. These will be called every time the associated event occurs.
def main():
#Create your Phidget channels
digitalOutput0 = DigitalOutput()
#Set addressing parameters to specify which channel to open (if any)
digitalOutput0.setDeviceSerialNumber(502246)
#Assign any event handlers you need before calling open so that no events are missed.
#Open your Phidgets and wait for attachment
digitalOutput0.openWaitForAttachment(5000)
#Do stuff with your Phidgets here or in your event handlers.
digitalOutput0.setDutyCycle(1)
try:
input("Press Enter to Stop\n")
except (Exception, KeyboardInterrupt):
pass
#Close your Phidgets once the program is done.
digitalOutput0.close()
main()
<code>
In the terminal, I run "python example.py", I get the following error:
Traceback (most recent call last):
File "example.py", line 30, in <module>
main()
File "example.py", line 17, in main
digitalOutput0.openWaitForAttachment(5000)
File "/home/pi/.local/lib/python2.7/site-packages/Phidget22/Phidget.py", line 561, in openWaitForAttachment
raise PhidgetException(result)
Phidget22.PhidgetException.PhidgetException: PhidgetException 0x03 (Timed Out)
No Phidgets were detected at all. Make sure your device is attached.
Now if I run the "HelloWorld.c" example, I get the proper result :
Opening...
Phidget Simple Playground (plug and unplug managers)
Press Enter to end anytime...
Hello Device PhidgetInterfaceKit 0/0/4, Serial Number: 502246
Hello Device PhidgetInterfaceKit 0/0/4, Serial Number: 502246
Hello Device PhidgetInterfaceKit 0/0/4, Serial Number: 502246
Hello Device PhidgetInterfaceKit 0/0/4, Serial Number: 502246
Closing...