Toit driver for the Adafruit's SHT31-D Digital Temperature and Humidity Sensor
-
toit pkg sync
-
toit pkg install github.com/harshkc03/sht31-d_driver
import i2c
import gpio
import sht31_d_driver.sht31
main:
bus := i2c.Bus
--sda=gpio.Pin 21
--scl=gpio.Pin 22
device := bus.device sht31.I2C_ADDRESS
driver := sht31.Driver device
print "$driver.read_temperature C"
print "$driver.read_humidity %"