Quantcast
Viewing all articles
Browse latest Browse all 1251

Python • Re: Converting w1thermsensor outputs to variables

However, I would like to be able to plot the results and have more control over the output, which sometimes prints out with multiple Decimal places.
I write my results to an SQLite DB then plot using PANDA and PLOTLY. See my current testing here https://3mlcam.naishfamily.net/

In terms of number of decimal points, here is the code I use reading a DS18B20 using W1ThermSensor

Code:

 temp_c = round(water_sensor.get_temperature(),2) # Get Temperatures
Is anyone able to advise me how to copy the output to a normal variable so that I can then store the results in an array. I currently have 2 sensors but in the future I want to be able to add more sensors, so the code needs to be able to cope with as many sensors as are connected.
I have multiple sensor and store the results in a DICT data type to separate them out.

Code:

reading={"lake":{}, "shore":{}, "cottage":{}, "test":{} }

Statistics: Posted by DS256 — Sat Mar 30, 2024 6:36 pm



Viewing all articles
Browse latest Browse all 1251

Trending Articles