Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Heizung
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
c3pb
Heizung
Commits
173da652
Commit
173da652
authored
1 year ago
by
Benjamin Koch
Browse files
Options
Downloads
Patches
Plain Diff
add temperature sensors
The one on the display PCB isn't working, right now.
parent
738f69e1
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
firmware/test1/heizung-test1/platformio.ini
+3
-1
3 additions, 1 deletion
firmware/test1/heizung-test1/platformio.ini
firmware/test1/heizung-test1/src/main.cpp
+23
-0
23 additions, 0 deletions
firmware/test1/heizung-test1/src/main.cpp
with
26 additions
and
1 deletion
firmware/test1/heizung-test1/platformio.ini
+
3
−
1
View file @
173da652
...
...
@@ -13,4 +13,6 @@ platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board
=
pico
framework
=
arduino
board_build.core
=
earlephilhower
lib_deps
=
adafruit/Adafruit SSD1306@^2.5.7
lib_deps
=
adafruit/Adafruit SSD1306@^2.5.7
sparkfun/SparkFun
TMP102
Breakout@^1.1.2
This diff is collapsed.
Click to expand it.
firmware/test1/heizung-test1/src/main.cpp
+
23
−
0
View file @
173da652
...
...
@@ -2,6 +2,7 @@
#include
<Wire.h>
#include
<Adafruit_GFX.h>
#include
<Adafruit_SSD1306.h>
#include
<SparkFunTMP102.h>
enum
Pinout
{
DRIVE1
=
0
,
...
...
@@ -42,6 +43,8 @@ bool hasDisplay;
#include
"logo.h"
TMP102
sensor0
,
sensor1
;
void
setup
()
{
rp2040
.
enableDoubleResetBootloader
();
...
...
@@ -80,6 +83,19 @@ void setup() {
display
.
drawBitmap
(
0
,
0
,
logo_data
,
logo_width
,
logo_height
,
SSD1306_WHITE
);
display
.
display
();
}
if
(
sensor0
.
begin
(
0x48
))
{
//0-3: 0:0.25Hz, 1:1Hz, 2:4Hz, 3:8Hz
sensor0
.
setConversionRate
(
2
);
sensor0
.
setExtendedMode
(
1
);
sensor0
.
wakeup
();
}
if
(
sensor1
.
begin
(
0x49
))
{
//0-3: 0:0.25Hz, 1:1Hz, 2:4Hz, 3:8Hz
sensor1
.
setConversionRate
(
2
);
sensor1
.
setExtendedMode
(
1
);
sensor1
.
wakeup
();
}
}
void
i2c_scan
()
{
...
...
@@ -204,6 +220,13 @@ void loop() {
display
.
print
(
digitalRead
(
REED4
)
?
'^'
:
'v'
);
display
.
println
();
auto
temp0
=
sensor0
.
readTempC
();
auto
temp1
=
sensor1
.
readTempC
();
display
.
print
(
F
(
"Temp: "
));
display
.
println
(
temp0
,
2
);
display
.
print
(
F
(
" "
));
display
.
println
(
temp1
,
2
);
display
.
display
();
}
...
...
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