mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
13 lines
300 B
Python
13 lines
300 B
Python
import time
|
|
import lps22h
|
|
from machine import Pin, I2C
|
|
|
|
bus = I2C(1, scl=Pin(15), sda=Pin(14))
|
|
lps = lps22h.LPS22H(bus)
|
|
|
|
while (True):
|
|
pressure = lps.pressure()
|
|
temperature = lps.temperature()
|
|
print("Pressure: %.2f hPa Temperature: %.2f C"%(pressure, temperature))
|
|
time.sleep_ms(100)
|