-->
Page 1 of 1

V2 CODE -How To ADD A 2ND TEMPERATURE SENSOR?

PostPosted: Mon Jun 13, 2016 12:01 pm
by joeman2116
Mmiscool, or anyone who might have the answers

I have been working with a temperature pgm which uses the dallis DS18B20 Series temperature sensor.

I am using version 2 of ESP8266 BASIC.

The program is working well and have finished mounting the esp12 into an eco wall plug.

Now:
I would like to add a second temp sensor( DS18B20) - one is for inside -current temperature and a new sensor for outside.

I looked thru the docs but did not see the formats for the 2nd sensor?
I am guessing at the required new code -

SAMPLE:

let curr = 0 ' ------------------------- for current sensor
let curr1= 0 '-------------------------added this for second sensor?

wprint "CurrTemp=" ' for current sensor1 - works
wprint htmlvar(curr) ' for current sensor1 - works

wprint"OutsideTemp" ' for new outside sensor2?
wprint htmlvar(curr1) 'for new outside sensor2



[refresh]
curr = temp(0) - current sensor1 - works
curr1 = temp(0) - new sensor???


Thanks for your help.

Joe

Re: V2 CODE -How To ADD A 2ND TEMPERATURE SENSOR?

PostPosted: Mon Jun 13, 2016 9:29 pm
by Mmiscool
To read each temp sensor.

Code: Select alltemp1 = temp(0) 'first sensor
temp2 = temp(1) 'second sensor