Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By joeman2116
#49127 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.

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 -


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

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

Thanks for your help.

User avatar
By Mmiscool
#49157 To read each temp sensor.

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