WeatherBoard 2 / Show - Non-Metric units?

Moderators: mdrjr, odroid

WeatherBoard 2 / Show - Non-Metric units?

Unread postby bebop_man » Fri Aug 04, 2017 1:11 pm

Just got a Weather Board 2, and attached it to an Odroid Show. I used the intructions from https://wiki.odroid.com/accessory/sensor/weather-board/example/odroid_show and all seems to be well, except the units default to metric. Since I'm one of the American savages ( :o ) that still use Imperial measurements (Feet, Farenheit, etc) would there be a way to get the WeatherBoard to output non-metric units?
bebop_man
 
Posts: 34
Joined: Sat Dec 13, 2014 1:21 am
languages_spoken: english
ODROIDs: x1 C1, x2 C2, x3 XU4.

Re: WeatherBoard 2 / Show - Non-Metric units?

Unread postby odroid » Fri Aug 04, 2017 3:10 pm

You have to modify the source code to convert the units.
Look into displayBME280() function.
https://github.com/hardkernel/WEATHER-B ... #L369-L391
User avatar
odroid
Site Admin
 
Posts: 25365
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: WeatherBoard 2 / Show - Non-Metric units?

Unread postby bebop_man » Fri Aug 04, 2017 10:57 pm

Thank you. I ended up changing the following lines for the conversion:

Code: Select all
void getBME280()
{
   BME280Temperature = bme.readTemperature()*(9/5)+32;
   BME280Pressure = (bme.readPressure()/100);
   BME280Humidity = bme.readHumidity();
   BME280Altitude = bme.readAltitude(SEALEVELPRESSURE_HPA)*3.28084;
bebop_man
 
Posts: 34
Joined: Sat Dec 13, 2014 1:21 am
languages_spoken: english
ODROIDs: x1 C1, x2 C2, x3 XU4.

Re: WeatherBoard 2 / Show - Non-Metric units?

Unread postby odroid » Sat Aug 05, 2017 10:57 am

Great!
Thank you for sharing the conversion code.
I've added it in the WiKi page.
https://wiki.odroid.com/accessory/senso ... enheit_etc
User avatar
odroid
Site Admin
 
Posts: 25365
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID


Return to Weather Board

Who is online

Users browsing this forum: No registered users and 1 guest