Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aerobs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Gattringer
aerobs
Commits
c94c0ae4
Commit
c94c0ae4
authored
1 year ago
by
Andreas Gattringer
Browse files
Options
Downloads
Patches
Plain Diff
rhtp: updated to new addresses, kept copy with old values in -orig
parent
0ae1daae
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
programs/rhtp-orig.py
+34
-0
34 additions, 0 deletions
programs/rhtp-orig.py
programs/rhtp.py
+1
-1
1 addition, 1 deletion
programs/rhtp.py
with
35 additions
and
1 deletion
programs/rhtp-orig.py
0 → 100644
+
34
−
0
View file @
c94c0ae4
import
sys
from
umnp.microcontroller.sensors.lps28dfw
import
LPS28DFW
from
umnp.microcontroller.sensors.sht45
import
SHT45
if
sys
.
implementation
.
name
==
"
micropython
"
:
# noinspection PyUnresolvedReferences
import
machine
# noinspection PyUnresolvedReferences
import
uasyncio
as
asyncio
else
:
from
umnp.microcontroller.umock
import
machine
async
def
main
():
i2c
=
machine
.
I2C
(
id
=
1
,
scl
=
machine
.
Pin
(
27
),
sda
=
machine
.
Pin
(
26
))
sht45
=
SHT45
(
i2c
)
p_sensor
=
LPS28DFW
(
i2c
,
i2c_address
=
0x5C
)
while
True
:
t
,
rh
=
await
sht45
.
measure
()
p
,
p_t
=
await
p_sensor
.
measure
()
print
(
f
"
temperature:
{
t
}
"
)
print
(
f
"
rH:
{
rh
}
"
)
print
(
f
"
pressure:
{
p
}
"
)
print
(
f
"
temperature (p):
{
p_t
}
"
)
print
()
print
()
await
asyncio
.
sleep
(
1
)
if
__name__
==
"
__main__
"
:
asyncio
.
run
(
main
())
This diff is collapsed.
Click to expand it.
programs/rhtp.py
+
1
−
1
View file @
c94c0ae4
...
...
@@ -14,7 +14,7 @@ else:
async
def
main
():
i2c
=
machine
.
I2C
(
id
=
1
,
scl
=
machine
.
Pin
(
27
),
sda
=
machine
.
Pin
(
26
))
i2c
=
machine
.
I2C
(
id
=
1
,
scl
=
machine
.
Pin
(
5
),
sda
=
machine
.
Pin
(
4
))
sht45
=
SHT45
(
i2c
)
p_sensor
=
LPS28DFW
(
i2c
)
while
True
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment