Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
autonome-zelle
agrar-zelle
Commits
e5925910
Commit
e5925910
authored
6 years ago
by
Andreas Motl
Browse files
Options
Download
Email Patches
Plain Diff
Naming things
parent
3a48d423
master
No related merge requests found
Pipeline
#12
failed with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/lib/bme280_esp32.py
+1
-0
src/lib/bme280_esp32.py
src/lib/bme280_esp8266.py
+2
-0
src/lib/bme280_esp8266.py
src/main.py
+23
-11
src/main.py
with
26 additions
and
11 deletions
+26
-11
src/lib/bme280_
1
.py
→
src/lib/bme280_
esp32
.py
+
1
-
0
View file @
e5925910
# Source: Probably derived from https://bitbucket.org/oscarBravo/wipy_bme280
#
# Author: Butch Anton 2017
# Based on the work by #Author: Paul Cunnane 2016
...
...
This diff is collapsed.
Click to expand it.
src/lib/bme280.py
→
src/lib/bme280
_esp8266
.py
+
2
-
0
View file @
e5925910
# Source: Probably derived from https://github.com/catdog2/mpy_bme280_esp8266/blob/master/bme280.py
#
# Authors: Paul Cunnane 2016, Peter Dahlebrg 2016
#
# This module borrows from the Adafruit BME280 Python library. Original
...
...
This diff is collapsed.
Click to expand it.
src/main.py
+
23
-
11
View file @
e5925910
from
machine
import
I2C
# configure the I2C bus
i2c
=
I2C
(
0
,
I2C
.
MASTER
,
baudrate
=
100000
)
print
(
i2c
.
scan
())
print
(
i2c
.
readfrom
(
0x76
,
5
))
#from machine import I2C
from
bme280
import
*
i2c
=
I2C
()
bme280
=
BME280
(
address
=
0x76
,
i2c
=
i2c
)
print
(
bme280
.
values
)
def
read_bme
(
adapter
):
# Configure the I2C bus
from
machine
import
I2C
i2c
=
I2C
(
0
,
I2C
.
MASTER
,
baudrate
=
100000
)
print
(
i2c
.
scan
())
#print(i2c.readfrom(0x76, 5))
# Read sensor
bme280
=
adapter
(
address
=
0x76
,
i2c
=
i2c
)
print
(
bme280
.
values
)
if
__name__
==
'__main__'
:
# ESP8266 adapter
#from bme280_esp8266 import BME280
# ESP32 adapter
from
bme280_esp32
import
BME280
# Read sensor with specified adapter
read_bme
(
BME280
)
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help