How to read channel 1 from 1045 ver.101

Supporting Browser-based Javascript and Node.js
Post Reply
dts350z
Fresh meat
Posts: 2
Joined: Wed Jul 04, 2018 2:22 pm
Contact:

How to read channel 1 from 1045 ver.101

Post 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
User avatar
mparadis
Site Admin
Posts: 959
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

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

Post 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.
dts350z
Fresh meat
Posts: 2
Joined: Wed Jul 04, 2018 2:22 pm
Contact:

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

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests