Variables in a loop, Newby question

vanommen.robert at gmail.com vanommen.robert at gmail.com
Tue Dec 24 13:27:13 EST 2013


Indeed this is code what I found on the web to read temperatures from 10 DS18B20 singlewire sensors.

My only programming (little) experience is VBA (Excel mostly).

avgtemperatures = [] is indeed from the original code where this line 

'avgtemperatures.append(sum(temperatures) / float(len(temperatures)))'

was added. i removed it.

You're right about the line sensorids. There are 10 sensors:

 sensorids = ["28-0000054c4932", "28-0000054c9454", "28-0000054c9fca", "28-0000054c4401", "28-0000054dab99", "28-0000054cf9b4", "28-0000054c8a03", "28-0000054d6780", $00054ccdfa", "28-0000054c4f9d"]


In this script i want to read the temperatures and make them available to other scripts.
 
One script to controll my solar water boiler and other heat exchangers connected to this boiler. (fire place for example) 
And in the future I want to make the temperatures available on a website and log them in a mysql database online.

But as I said before, I am just a few days trying to learn how to do it.

Thanks for your time.

greetings Robert



More information about the Python-list mailing list