sensirion / arduino-snippets Goto Github PK
View Code? Open in Web Editor NEWArduino code examples for raw sensor communication with many Sensirion sensors
License: BSD 3-Clause "New" or "Revised" License
Arduino code examples for raw sensor communication with many Sensirion sensors
License: BSD 3-Clause "New" or "Revised" License
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);
I'm not super familiar with Arduino code and I'm trying to figure out if the forced recalibration SCD4x snippet is something I can just run once, then switch back to the usual periodic measurement script provided in the tutorial I followed. Will the calibration persist? If not, how can I edit the re-calibration code to turn this feature on?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.