Linted Examples

This commit is contained in:
Melissa LeBlanc-Williams 2021-11-16 14:15:31 -08:00
parent efb0bee540
commit ba56862a5c
2 changed files with 4 additions and 3 deletions

View file

@ -10,4 +10,4 @@ from adafruit_extended_bus import ExtendedI2C as I2C
# Create library object using our Extended Bus I2C port
i2c = I2C(1) # Device is /dev/i2c-1
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)
print("\nTemperature: %0.1f C" % bme280.temperature)
print(f"\nTemperature: {bme280.temperature:0.1f} C")

View file

@ -3,13 +3,14 @@ This exmaple demonstrates how to instantiate the
Adafruit BME280 Sensor using this library and just
the SPI bus and chip enable numbers.
Please note that Linux will mess with the system CE pins, so
Please note that Linux will mess with the system CE pins, so
we are using an alternate pin for the Chip Enable line. This
library is more useful for using a SPI Device on a Bus other
than 0
"""
import board
import digitalio
import adafruit_bme280
from adafruit_extended_bus import ExtendedSPI as SPI
@ -17,4 +18,4 @@ from adafruit_extended_bus import ExtendedSPI as SPI
spi = SPI(1, 0) # Device is /dev/spidev1.0
cs = digitalio.DigitalInOut(board.D5)
bme280 = adafruit_bme280.Adafruit_BME280_SPI(spi, cs)
print("\nTemperature: %0.1f C" % bme280.temperature)
print(f"\nTemperature: {bme280.temperature:0.1f} C")