adafruit / Adafruit_BME280_Library

Arduino Library for BME280 sensors
Other
328 stars 301 forks source link

Temperature conversion functions #89

Closed tjm-git closed 3 years ago

tjm-git commented 3 years ago

Is it possible to get functions to convert Celsius to Fahrenheit and back to the ADAFRUIT_BME280 lib? I can provide the code but not sure of the best place to insert it in the .h and .cpp .

thanks, tjm

siddacious commented 3 years ago

Thanks for the input; While Fahrenheit conversion is useful, it's probably better suited to something like the unified sensor library, since any sensor could make use of it https://github.com/adafruit/Adafruit_Sensor

That said, I would be surprised if there wasn't already a standardized/common C to F conversion function somewhere else.

For your own uses, if you're using Arduino, you can just put a function in your sketch. If you want to put it elsewhere, you'll need to add the declaration to the appropriate header file, and the definition in the corresponding c/cpp file