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
7d84d0a0
Commit
7d84d0a0
authored
Jan 02, 2019
by
Rousseau Vincent
Browse files
Add reading of environmental sensors
parent
d4cb8abf
Changes
1
Hide whitespace changes
Inline
Side-by-side
environmental_sensors.py
0 → 100644
View file @
7d84d0a0
from
sense_hat
import
SenseHat
sense
=
SenseHat
()
humidity
=
sense
.
get_humidity
()
temp_humidity
=
sense
.
get_temperature_from_humidity
()
print
(
"Humidity sensor : {:.2f} %rH , {:.2f} °C"
.
format
(
humidity
,
temp_humidity
))
pressure
=
sense
.
get_pressure
()
temp_pressure
=
sense
.
get_temperature_from_pressure
()
print
(
"Pressure sensor : {:.2f} Millibars , {:.2f} °C"
.
format
(
pressure
,
temp_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