Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
raspberry-pi
sense-hat
Commits
4e91a486
Commit
4e91a486
authored
Jan 09, 2019
by
Rousseau Vincent
Browse files
Generate a value every minute
parent
a0a0f690
Changes
1
Show whitespace changes
Inline
Side-by-side
environmental_sensors.py
View file @
4e91a486
...
...
@@ -19,8 +19,8 @@ def get_data():
temp_humidity
=
[]
pressure
=
[]
temp_pressure
=
[]
# Store sensor values every second during one
hour
for
_
in
range
(
360
0
):
# Store sensor values every second during one
minute
for
_
in
range
(
6
0
):
humidity
.
append
(
sense
.
get_humidity
())
temp_humidity
.
append
(
sense
.
get_temperature_from_humidity
())
pressure
.
append
(
sense
.
get_pressure
())
...
...
@@ -29,8 +29,8 @@ def get_data():
#print("Humidity sensor : {} %rH , {} °C".format(humidity, temp_humidity))
#print("Pressure sensor : {} Millibars , {} °C".format(pressure, temp_pressure))
# Get the mean value during the
hour
return
[(
datetime
.
now
()
-
timedelta
(
minute
s
=
30
)).
timestamp
(),
# Get the mean value during the
minute
return
[(
datetime
.
now
()
-
timedelta
(
second
s
=
30
)).
timestamp
(),
float_mean
(
humidity
),
float_mean
(
temp_humidity
),
float_mean
(
pressure
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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