Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
d354b2c0
Commit
d354b2c0
authored
3 years ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
Compiles again. Not working yet
parent
a4e0fed5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ampel-firmware/co2_sensor.cpp
+4
-2
ampel-firmware/co2_sensor.cpp
with
4 additions
and
2 deletions
+4
-2
ampel-firmware/co2_sensor.cpp
+
4
-
2
View file @
d354b2c0
...
@@ -226,9 +226,11 @@ namespace sensor {
...
@@ -226,9 +226,11 @@ namespace sensor {
* Returns true if fresh data is available, for further processing (e.g. MQTT, CSV or LoRa)
* Returns true if fresh data is available, for further processing (e.g. MQTT, CSV or LoRa)
*/
*/
bool
processData
()
{
bool
processData
()
{
bool
freshData
=
scd30
.
dataAvailable
();
static
unsigned
long
last_measurement
=
0
;
unsigned
long
now
=
seconds
();
bool
freshData
=
now
-
last_measurement
>
config
::
measurement_timestep
;
if
(
freshData
)
{
if
(
freshData
)
{
last_measurement
=
now
;
ntp
::
getLocalTime
(
timestamp
);
ntp
::
getLocalTime
(
timestamp
);
co2
=
sensor_S8
->
get_co2
();
co2
=
sensor_S8
->
get_co2
();
temperature
=
0.0
;
temperature
=
0.0
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment