Show Fahrenheit on PicoBricks OLED Instead of Celsius: Difference between revisions

From ikev.in/w
(Created page with "In the file '''main.py''', replace this: <pre> oled.text("TEMP: {0:.2f}C".format(dht_sensor.temperature),0,30) </pre> ...with this: <pre> oled.text("TEMP: {0:.2f}F".format((dht_sensor.temperature * 1.8) + 32),0,30) </pre>")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 10: Line 10:
oled.text("TEMP:    {0:.2f}F".format((dht_sensor.temperature * 1.8) + 32),0,30)
oled.text("TEMP:    {0:.2f}F".format((dht_sensor.temperature * 1.8) + 32),0,30)
</pre>
</pre>
==External Links==
* [https://github.com/Robotistan/PicoBricks/tree/main/Software/Pre-Installed%20Code Pre-installed PicoBricks Code]
[[Category: Tutorials]]
[[Category: PicoBricks]]

Latest revision as of 21:36, 28 April 2023

In the file main.py, replace this:

oled.text("TEMP:     {0:.2f}C".format(dht_sensor.temperature),0,30)

...with this:

oled.text("TEMP:     {0:.2f}F".format((dht_sensor.temperature * 1.8) + 32),0,30)

External Links