Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1251

Python • Re: BME280, convert temp C to F

$
0
0
It looks like you are trying to modify the code in the library module .... DON'T. You're changes will be lost in updates. Plus it is not good practice unless the creator has told you how to overload code/functions.

Take the return value and convert it in your code. Something like this but your calls will likely be different

Code:

temp_c = round(water_sensor.get_temperature(),2) # Get Temperaturestemp_f = round((temp_c * (9 / 5) + 32) ,2)

Statistics: Posted by DS256 — Mon Feb 10, 2025 1:38 am



Viewing all articles
Browse latest Browse all 1251

Trending Articles