Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented real calculated variables #153

Merged
merged 49 commits into from
Sep 6, 2018
Merged
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
908a7d9
Beginning stages of calculated vars
SRGDamia1 May 22, 2018
6221d5b
Added a calculated variable to the single sensor example
SRGDamia1 May 22, 2018
3696e25
Arrays should now deal with calculated variables
SRGDamia1 May 22, 2018
f9a0a34
Fixed single_sensor for Travis
SRGDamia1 May 22, 2018
d2979c5
Made calculation in single_sensor less trivial
SRGDamia1 May 22, 2018
3a0fa59
debugging correction
SRGDamia1 May 22, 2018
1574b90
Added helper functions for parent sensors of variables
SRGDamia1 May 22, 2018
c6cbd3d
Debugging changes
SRGDamia1 May 22, 2018
bc67a87
baro/density correction example now uses calculated variables
SRGDamia1 May 22, 2018
eb68357
Updated ReadMe, bumped version
SRGDamia1 May 22, 2018
0f45d0e
Made sure calculations will return -9999 if inputs are -9999
SRGDamia1 May 22, 2018
5d6112a
Added sanity check to MS5803
SRGDamia1 May 22, 2018
e2465d0
Moved variable array init to constructor
SRGDamia1 May 22, 2018
e7958c3
Don't need so many print fxns in VariableArray
SRGDamia1 May 23, 2018
543c2dd
Renamed internal array and made public
SRGDamia1 May 23, 2018
cf2732f
A logger is NO LONGER a subclass of variable array
SRGDamia1 May 23, 2018
a33ed46
Changed order of logger constructor
SRGDamia1 May 23, 2018
18eec37
Updated examples
SRGDamia1 May 23, 2018
dcc0a5e
Fixed example
SRGDamia1 May 23, 2018
327467f
Removed unpopular "checkForTestingMode"
SRGDamia1 May 23, 2018
7c70c58
Some small clean-up
SRGDamia1 May 23, 2018
2ac9dc8
Fix for removed _sleep
SRGDamia1 May 23, 2018
9423113
Fixed multisensor_print
SRGDamia1 May 23, 2018
2734d32
Made testing mode part of a logger
SRGDamia1 May 23, 2018
4ae43cb
Restructured to allow data to be streamed to SD card
SRGDamia1 May 24, 2018
60ca9eb
Added missing new line in csv and EnviroDIY header
SRGDamia1 May 24, 2018
45e4048
stream header must be virtual
SRGDamia1 May 24, 2018
6d187da
Fixed some serial.print vs PRINTOUT
SRGDamia1 May 24, 2018
88bef71
Cleaned up some generate vs stream functions
SRGDamia1 May 24, 2018
f08b6fc
Update ReadMe, bumped version
SRGDamia1 May 24, 2018
b0ee96a
Minor example rearranging
SRGDamia1 May 24, 2018
7f7a47e
Updated platformio's
SRGDamia1 May 24, 2018
14f61a0
Fixed modem name typo
SRGDamia1 May 24, 2018
30ffbb8
Merge pull request #155 from EnviroDIY/killInit
SRGDamia1 May 24, 2018
a84934e
Cleaned up some messiness with creating a file name
SRGDamia1 May 24, 2018
7503016
Fixed if statement in example
SRGDamia1 May 31, 2018
559da6f
Changed some pointers to references
SRGDamia1 May 31, 2018
c5414ee
Fix broken example
SRGDamia1 May 31, 2018
1c73762
More pointers to refs
SRGDamia1 May 31, 2018
15df45f
Strings to character arrays
SRGDamia1 May 31, 2018
70846cb
Lots more string to char
SRGDamia1 May 31, 2018
de55912
Tweek examples
SRGDamia1 May 31, 2018
8723b1a
Missed loggermodem
SRGDamia1 May 31, 2018
5859ef3
Moved unknown into class to fix multiple declarations
SRGDamia1 Jun 1, 2018
af14248
Mostly updates to documentation
SRGDamia1 Jun 1, 2018
f68abed
Merge pull request #157 from EnviroDIY/pointerRef
SRGDamia1 Jun 1, 2018
d5b5efc
Slimmed modem on/off methods
SRGDamia1 Jun 4, 2018
4a10279
Not trying to register to network before asking for CSQ
SRGDamia1 Jun 4, 2018
6892a0f
Correct typos in code
aufdenkampe Sep 6, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Made sure calculations will return -9999 if inputs are -9999
This will always be dependent on the user implementing the -9999 return in their calculation function.
SRGDamia1 committed May 22, 2018
commit 0f45d0e76cd122ad5650dbb88e153a84fb0f3e35
9 changes: 8 additions & 1 deletion examples/baro_rho_correction/baro_rho_correction.ino
Original file line number Diff line number Diff line change
@@ -187,7 +187,11 @@ Variable *msPress = new MeaSpecMS5803_Pressure(&ms5803, "12345678-abcd-1234-efgh
// 1 pascal = 0.01 mbar
float calculateWaterPressure(void)
{
float waterPressure = msPress->getValue() - (bPress->getValue())*0.01;
float totalPressureFromMS5803 = msPress->getValue();
float baroPressureFromBME280 = bPress->getValue();
float waterPressure = totalPressureFromMS5803 - (baroPressureFromBME280)*0.01;
if (totalPressureFromMS5803 = -9999 || baroPressureFromBME280 == -9999)
waterPressure = -9999;
// Serial.print(F("Water pressure is ")); // for debugging
// Serial.println(waterPressure); // for debugging
return waterPressure;
@@ -209,6 +213,7 @@ Variable *calcWaterPress = new Variable(calculateWaterPressure, waterPresureVarN
float calculateWaterDepthRaw(void)
{
float waterDepth = calculateWaterPressure()*10.1972;
if (calculateWaterPressure() == -9999) waterDepth = -9999;
// Serial.print(F("'Raw' water depth is ")); // for debugging
// Serial.println(waterDepth); // for debugging
return waterDepth;
@@ -243,6 +248,8 @@ float calculateWaterDepthTempCorrected(void)
// This calculation gives a final result in mm of water
// from P = rho * g * h
float rhoDepth = 1000 * waterPressurePa/(waterDensity * gravitationalConstant);
if (calculateWaterPressure() == -9999 || waterTempertureC == -9999)
rhoDepth = -9999;
// Serial.print(F("Temperature corrected water depth is ")); // for debugging
// Serial.println(rhoDepth); // for debugging
return rhoDepth;