Giter VIP home page Giter VIP logo

arduino-snippets's Issues

Integer Overflow in SCD4x_I2C_FRC_Forced_Recalibration_Example.ino

Line 63 in SCD4x_I2C_FRC_Forced_Recalibration_Example.ino causes an integer overflow:
delay(5 * 60 * 1000);
In an Arduino Uno and other ATmega based boards the maximum value for an int is 32,767. Consequently, 5 * 60 * 1000 gets evaluated to a negative number and the delay never terminates.
Possible solution:
delay(5 * 60 * (long)1000);

Scd4x forced calibration code not working properly

Hi,
I found that your code "SCD4x_I2C_FRC_Forced_Recalibration_Example.ino" was not working properly.
Instead of waiting for the sensor to startup and equalize itself to ambient levels, it started the calibration directly after powerup.

I found that at line 99, the delay was commented.

97 // wait for another 5 minutes to equilibrate sensor to ambient
98 Serial.println("# Waiting 5 minutes for equilibration");
99 //delay(5 * 60 * 1000);

I uncommented this delay, but also moved it up to line 60. This was because the values used as "CO2 values before recalibration" (lines 66-76) where saved before the initial equilibration delay at line 99.

Could you confirm this?
After I made the changes, sensorreadings where as expected from ~400PPM co2 levels in the outside ambient air.

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.