Code: Select all
from Phidgets.Devices.InterfaceKit import InterfaceKit
localIFK= InterfaceKit()
localIFK.openPhidget()
localIFK.waitForAttach(10000)
sensorvalue = localIFK.getSensorValue(0)
roomtemp = (int)((sensorvalue * 0.22222) - 61.11);
print ("The temperature in this room is: %d" %roomtemp)
Then I put the 1124 on a remote sbc and tried it again.
Code: Select all
from Phidgets.Devices.InterfaceKit import InterfaceKit
remoteIFK= InterfaceKit()
remoteIFK.openRemoteIP("192.168.83.142",5001,"")
remoteIFK.waitForAttach(10000)
sensorvalue = remoteIFK.getSensorValue(0)
roomtemp = (int)((sensorvalue * 0.22222) - 61.11);
print ("The temperature in this room is: %d" %roomtemp)
Traceback (most recent call last):
File "C:\Python32\simpleTemperaturSensor.py", line 6, in <module>
remoteIFK.openRemoteIP("192.168.83.142",5001,"")
File "C:\Python32\lib\site-packages\Phidgets\Phidget.py", line 399, in openRemoteIP
result = PhidgetLibrary.getDll().CPhidget_openRemoteIP(self.handle, c_int(serial), c_char_p(IPAddress), c_int(port), c_char_p(password))
TypeError: bytes or integer address expected instead of str instance
I'm sure there is a very simple answer. Can anyone help?