pimoroni / bme280-python

Python library for the BME280 temperature, pressure and humidity sensor
https://shop.pimoroni.com/products/bme280-breakout
MIT License
64 stars 25 forks source link

ValueError: Invalid format specifier when running allvalues.py #21

Closed liamsanchez closed 9 months ago

liamsanchez commented 2 years ago

installed the PIMORONI BME280 breakout on pins 1, 3, 5, 7, 9, on my RaspberryPI-4 however - when I run the allvalues.py example i get the following error:

Ctrl+C to exit Traceback (most recent call last): File "/home/pi/BME280 test.py", line 19, in print('{:05.2f}*C {:05.2f}hPa {:05:2f}%'.format(temperature, pressure, humidity)) ValueError: Invalid format specifier

Gadgetoid commented 2 years ago

Whoops indeed “:05:2f” is wrong; that should be “:05.2f” for five digits and two decimal places.