Git Product home page Git Product logo

embedded-i2c-sgp41's Issues

Unused size parameter in sgp41_get_serial_number() function

In the sgp41_get_serial_number() function, the serial_number_size parameter is unused:

int16_t sgp41_get_serial_number(uint16_t* serial_number,
uint8_t serial_number_size) {
int16_t error;
uint8_t buffer[9];
uint16_t offset = 0;
offset = sensirion_i2c_add_command_to_buffer(&buffer[0], offset, 0x3682);
error = sensirion_i2c_write_data(SGP41_I2C_ADDRESS, &buffer[0], offset);
if (error) {
return error;
}
sensirion_i2c_hal_sleep_usec(1000);
error = sensirion_i2c_read_data_inplace(SGP41_I2C_ADDRESS, &buffer[0], 6);
if (error) {
return error;
}
serial_number[0] = sensirion_common_bytes_to_uint16_t(&buffer[0]);
serial_number[1] = sensirion_common_bytes_to_uint16_t(&buffer[2]);
serial_number[2] = sensirion_common_bytes_to_uint16_t(&buffer[4]);
return NO_ERROR;
}

Also it's not mentioned as a parameter in the header:

/**
* sgp41_get_serial_number() - This command provides the decimal serial number
* of the SGP41 chip by returning 3x2 bytes.
*
* @param serial_number 48-bit unique serial number
*
* @return 0 on success, an error code otherwise
*/
int16_t sgp41_get_serial_number(uint16_t* serial_number,
uint8_t serial_number_size);

Not enough data received in sam21d boards

Hi, I'm been trying to get any reading from my sgp41 sensor with a seeeduino xiao and no success.
I'm using the example in this library. It gives the serial number but in the selfTest answers "not enough data received".
The board is based on the sam21d microcontroller and I've seen around that with esp boards the library has the same problem.
All the best,
Javi

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.