Skip to content

Commit 4a5be0a

Browse files
committedMay 17, 2018
SGP wrong temp workaround
1 parent 54acd03 commit 4a5be0a

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed
 

‎ardufocus/ardufocus.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ int main(void)
6565
// ADC init routine ---------------------------------------------------------
6666
// --------------------------------------------------------------------------
6767
Analog::setup();
68+
Analog::read(THERMISTOR_ADC_CHANNEL);
6869

6970

7071
// --------------------------------------------------------------------------

‎ardufocus/config.h

+9
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@
9191
// verify if the overall system accuracy increases.
9292
//#define COMPRESS_HALF_STEPS
9393

94+
95+
// According to the Moonlite protocol the temperature probe should only be read
96+
// when the command ":C#" is received but some applications, such as SGP, seems
97+
// not to respect this and only call the get temperature command ":GT#" which
98+
// means the temperature will never get updated and the last value is always
99+
// returned, either it is valid or not. Enabling the following option will force
100+
// the temperature gathering process on every temperature read command.
101+
// #define START_TEMP_CONVERSION_ON_EVERY_GET
102+
94103
// ----------------------------------------------------------------------------
95104
// Temperature sensor configuration -------------------------------------------
96105
// ----------------------------------------------------------------------------

‎ardufocus/protocol.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ void protocol::process(const char *cmd)
7878
break;
7979

8080
case 'T': // Get the current temperature
81+
#ifdef START_TEMP_CONVERSION_ON_EVERY_GET
82+
Analog::read(THERMISTOR_ADC_CHANNEL);
83+
#endif
84+
8185
sprintf(str, "%04X#", static_cast<int16_t>(util::steinhart(g_ambient)) << 1);
8286
Log::string(str);
8387
break;

‎ardufocus/version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
#define __VERSION_H__
2222

2323
// Program version and release
24-
#define ARDUFOCUS_VERSION "0.1c"
25-
#define ARDUFOCUS_VERSION_BUILD "20180315"
24+
#define ARDUFOCUS_VERSION "0.1d"
25+
#define ARDUFOCUS_VERSION_BUILD "20180517"
2626
#define ARDUFOCUS_URL "https://github.com/jbrazio/ardufocus"
2727

2828
#endif

0 commit comments

Comments
 (0)
Please sign in to comment.