Git Product home page Git Product logo

micropython_scd4x's Introduction

MicroPython_SCD4X

MicroPython driver for Sensirion SCD40 and SCD41 with I2C interface. Derived from the Adafruit CircuitPython version.

Usage

A usage example can be found in the code.

Implementation Notes

The scd4x.py module provides a helper class SCD4X() that enables I2C interaction with a SCD40 or SCD41 sensor.

Details of the adafruit breakout board for the sensor and the methods provided by the SCD4X() class can be found in the Adafruit SCD4X documentation implementation notes.

[The SCD41 sensor provides additional low power/ lower sampling rate commands that are not implemented in this driver. See the Sensirion datasheet for the sensors for details.]

micropython_scd4x's People

Contributors

peter-l5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

joernalraun

micropython_scd4x's Issues

error in _set_command_value method

I am having a problem with this section of code:

def _set_command_value(self, cmd, value, cmd_delay=0):
    self._buffer[0] = (cmd >> 8) & 0xFF
    self._buffer[1] = cmd & 0xFF
    self._crc_buffer[0] = self._buffer[2] = (value >> 8) & 0xFF
    self._crc_buffer[1] = self._buffer[3] = value & 0xFF
    self._buffer[4] = self._crc8(self._crc_buffer)
    self.i2c_device.i2c.write(self.address, self._buffer) # error in this line 'AttributeError: 'I2C' object has no attribute 'i2c'

when I remove the second i2c tag in this line I get - "TypeError: function takes 2 positional arguments but 3 were given" - When commenting out this line, rest of code runs fine.
time.sleep(cmd_delay)
Any Ideas of what has gone wrong?

Originally posted by @bocephasj in #3 (comment)

Memory errors?

When running I get this :
MemoryError: memory allocation failed, allocating %u bytes

running this on Xbee3 with scd41 attached to grove board
I am fairly new to Python/MicroPython. willing to pay for assistance in getting this setup working!!!

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.