Code Monkey home page Code Monkey logo

Comments (2)

sdmueller avatar sdmueller commented on August 21, 2024

Hi @lemorage

The error codes are platform dependent. I2C in general only knows success or fail. However, our Arduino drivers use the arduino-core library which has its own error codes defined in SensirionErrors.h.

If you use the example program as is, the error code will be translated via the errorToString function and you should see the resulting error also as text.

Where the error seems to come from in your case:
scd4x.getDataReadyFlag uses SensirionI2CCommunication::sendFrame from arduino-core, which has some error handling. 267 is the bitwise OR combination of the high level error WriteError and the low level error I2cAddressNack. This means that there was no response on the I2C address you used. But errorToString should translate that already for you.

Hope this helps!

from arduino-i2c-scd4x.

lemorage avatar lemorage commented on August 21, 2024

Ohh, thank you for your detailed explanation! I suspected there should be something wrong with the I2C devices, but I couldn't find the exact reason. The program just didn't print anything when errorToString(error, errormsg, 256); was there, and I had to manually print the return value of scd4x.getDataReadyFlag to see if it was 0. So I really thought hard to figure out what is the sense of this error number.

from arduino-i2c-scd4x.

Related Issues (20)

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.