Page 1 of 1

How to read channel 1 from 1045 ver.101

Posted: Wed Jul 04, 2018 2:28 pm
by dts350z
I have a 1045 IR Temp sensor.

I'm using the example TempratureSensor.html and Phidget22 libs to read the IR temp, and I've also added a chart with dygraph.js

Now I would like to add the IC temp on channel 1, but looking at the javascript I don't see how to do it.

Please advise.

Thanks,
Z

Re: How to read channel 1 from 1045 ver.101

Posted: Fri Jul 06, 2018 7:47 am
by mparadis
Inside

Code: Select all

$(document).ready
, you need to define a second TemperatureSensor object. Then, you need to set the channel for that object to 1, which is the index for the IC sensor (as listed on the API tab on the 1045 product page). It would look something like this:

Code: Select all

var ir = new phidget22.TemperatureSensor();
var ic = new phidget22.TemperatureSensor();

ir.setChannel(0);
ic.setChannel(1);
Then where you see

Code: Select all

open()
called, use open on the other object as well.

Re: How to read channel 1 from 1045 ver.101

Posted: Fri Jul 06, 2018 11:52 am
by dts350z
Yeah I slogged through it and got it working.

Thanks!

screen shot:
https://drive.google.com/file/d/150gGOj ... p=sharing

FYI I made a "cloud sensor". Pointing the IR sensor at the night sky, it will read below 0 degrees C if no clouds. Clouds will read higher than 0 degrees C.

This is useful in astrophotography as by looking at the graph you can tell why everything stopped working (clouds) and do things like close your observatory roof.