Print Brain temp as degrees Farenheit

While I have this code, i found out that its a percentage ranging from 0=20 to 100= 70 degrees Celsius. How do i print the temp as an actual value of Fahrenheit and not a percentage?

if 0% is 20 degrees Celsius and 100% is 70 degrees Celsius, than you know that for every increase in percentage, it’s a half degree increase in temperature Celsius. so the equation for the temperature in Celsius is (percentage/2)+20

to convert that number from Celsius to Fahrenheit, multiply that output by 1.8 and add 32.

3 Likes

That will work, but you can also get the temperature in Fahrenheit directly – just pass temperatureUnits::fahrenheit to temperature instead of percentUnits::pct.

8 Likes