How to read different thermocouples from 1048
Posted: Sun Sep 10, 2017 7:55 pm
I'm trying to update my code from Phidgets21 to Phidget22 in Python and the APIs seem to have changed quite drastically. It's really confusing how to get different temperatures when the 4-input 1048 Temperature Sensor.
Previous, the temperature changed callback had a signature like this:
...where `index` was the thermocouple number, from 0-3.
The callback now get's two variables, the event and temperature. However, "index" is now gone from the event object. How are we supposed to read all four temperature?
I've looked through the docs and they are unhelpful...these details are completely missing from them, sadly. There is zero information on how to handle multiple TC inputs.
Help appreciated.
Previous, the temperature changed callback had a signature like this:
Code: Select all
def TemperatureChangeHandler(event):
print(event.index, event.temperature)
The callback now get's two variables, the event and temperature. However, "index" is now gone from the event object. How are we supposed to read all four temperature?
Code: Select all
def TemperatureChangeHandler(event, temperature):
# no more event.index
Help appreciated.