This is the code I use to get the data:
Code: Select all
from Phidget22.Phidget import *
from Phidget22.Devices.TemperatureSensor import *
from time import *
y1=[]
y2=[]
y3=[]
def init_board():
ch = TemperatureSensor()
ch.setChannel(4)
ch.openWaitForAttachment(1000)
ch2 = TemperatureSensor()
ch2.setChannel(0)
ch2.openWaitForAttachment(1000)
ch3 = TemperatureSensor()
ch3.setChannel(1)
ch3.openWaitForAttachment(1000)
return ch, ch2, ch3
(ch, ch2, ch3)=init_board()
try :
while True :
temperature1 = ch.getTemperature()
temperature2= ch2.getTemperature()
temperature3= ch3.getTemperature()
print(temperature1, temperature2, temperature3)
sleep(1)
except(KeyboardInterrupt):
ch.close()
ch2.close()
ch3.close()
Thanks in advance for the help !