Git Product home page Git Product logo

sht31-d_driver's Introduction

SHT31-D

Toit driver for the Adafruit's SHT31-D Digital Temperature and Humidity Sensor

Installation

  1. toit pkg sync

  2. toit pkg install github.com/harshkc03/sht31-d_driver

Usage

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 %"

sht31-d_driver's People

Watchers

 avatar  avatar

Forkers

robvanlopik

sht31-d_driver's Issues

I2C_WRITE_FAILED

Help me out here. I'm new to toit & haven't gotten anything to work yet so maybe I've not set up VS Code correctly but in trying to run sht31_demo I got this output:

1970-01-01T00:00:23.356683Z: <device boot - reason: Reset after exiting deep sleep mode.>
1970-01-01T00:00:25.298246Z: INFO: connected to wifi (Focus Wireless) in 1 second
2022-06-30T20:39:01.421558Z: <process initiated>
2022-06-30T20:39:01.472837Z: <stack trace>
EXCEPTION error.
I2C_WRITE_FAILED
0: Device.write.<block> <sdk>/i2c.toit:135:18
1: Bus.write_ <sdk>/i2c.toit:89:25
2: Device.write <sdk>/i2c.toit:143:10
3: Device.write <sdk>/i2c.toit:135:5
4: Driver.write_command <pkg:..>/driver.toit:132:13
5: Driver.reset <pkg:..>/driver.toit:61:5
6: Driver.initialize <pkg:..>/driver.toit:40:5
7: Driver <pkg:..>/driver.toit:37:5
8: main /c:/Users/ralexander/OneDrive/Documents/VScode/.packages/github.com/harshkc03/sht31-d_driver/1.0.0/examples/sht31_demo.toit:16:20
9: _entry_.<lambda> <sdk>/core/entry.toit:48:20

2022-06-30T20:39:01.490033Z: <process terminated - exit code: 1>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.