Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arduino-block-course
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
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stefan Gehr
arduino-block-course
Commits
7f4e0ed0
Commit
7f4e0ed0
authored
Oct 13, 2022
by
Mario Engelmann
Browse files
Options
Downloads
Plain Diff
hope for the best
parents
d17b9a48
5798fb6b
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
solarpump/mp3.h
+1
-1
1 addition, 1 deletion
solarpump/mp3.h
solarpump/mp3.ino
+7
-3
7 additions, 3 deletions
solarpump/mp3.ino
solarpump/solarpump.ino
+23
-2
23 additions, 2 deletions
solarpump/solarpump.ino
with
31 additions
and
6 deletions
solarpump/mp3.h
+
1
−
1
View file @
7f4e0ed0
...
...
@@ -2,7 +2,7 @@
#define MP3_H
void
mp3Setup
(
void
);
void
playFile
(
uint8_t
fileNumber
);
void
playFile
(
uint8_t
fileNumber
,
bool
respectBusyPin
);
void
mp3Loop
(
void
);
void
playFileQueue
(
uint8_t
fileNumber
);
...
...
This diff is collapsed.
Click to expand it.
solarpump/mp3.ino
+
7
−
3
View file @
7f4e0ed0
...
...
@@ -4,7 +4,7 @@
static
SoftwareSerial
mp3
(
MP3RX
,
MP3TX
);
// the queue for playing sounds
#define QUEUESIZE
1
6
#define QUEUESIZE 6
4
static
uint8_t
fileQueue
[
QUEUESIZE
];
// needs to be run once at the start
...
...
@@ -14,8 +14,12 @@ void mp3Setup(void) {
//mp3.sendCommand(CMD_SEL_DEV, 0, 2); //select sd-card
}
// immediately play a file, ignoring any queue or BUSY pin
void
playFile
(
uint8_t
fileNumber
)
{
// immediately play a file
void
playFile
(
uint8_t
fileNumber
,
bool
respectBusyPin
)
{
// do nothing if we want to wait for the BUSY pin
if
(
respectBusyPin
&&
digitalRead
(
MP3BUSY
))
{
return
;
}
mp3
.
write
(
fileNumber
);
}
...
...
This diff is collapsed.
Click to expand it.
solarpump/solarpump.ino
+
23
−
2
View file @
7f4e0ed0
...
...
@@ -170,10 +170,17 @@ void setup(void) {
pinMode
(
BUTTON
,
INPUT_PULLUP
);
}
<<<<<<<
HEAD
void
sayInfos
(
float
temp1up
,
float
temp1down
,
float
temp2up
,
float
temp2down
,
uint8_t
comma
)
=======
// say out all the relevant infos via the loudspeaker
void
sayInfos
(
float
t1up_C
,
float
t1down_C
,
float
t2up_C
,
float
t2down_C
)
>>>>>>>
5798
fb6b122134e1e016b6e47ca39eb79566fdc7
{
const
uint8_t
decimals
=
0
;
playFileQueue
(
SOUND_EINS
);
playFileQueue
(
SOUND_OBEN
);
<<<<<<<
HEAD
sayNumber
(
temp1up
,
nachKommaStellen
);
playFileQueue
(
SOUND_STILLE
);
...
...
@@ -191,6 +198,21 @@ void sayInfos(float temp1up, float temp1down, float temp2up, float temp2down, ui
playFileQueue
(
SOUND_UNTEN
);
sayNumber
(
temp2down
,
nachKommaStellen
);
playFileQueue
(
SOUND_STILLE
);
=======
sayNumber
(
t1up_C
,
decimals
);
playFileQueue
(
SOUND_EINS
);
playFileQueue
(
SOUND_UNTEN
);
sayNumber
(
t1down_C
,
decimals
);
playFileQueue
(
SOUND_ZWEI
);
playFileQueue
(
SOUND_OBEN
);
sayNumber
(
t2up_C
,
decimals
);
playFileQueue
(
SOUND_ZWEI
);
playFileQueue
(
SOUND_UNTEN
);
sayNumber
(
t2down_C
,
decimals
);
>>>>>>>
5798
fb6b122134e1e016b6e47ca39eb79566fdc7
if
(
digitalRead
(
PUMP1
))
{
...
...
@@ -235,13 +257,12 @@ void loop(void) {
static
float
t1down_C
=
0.0
;
static
float
t2up_C
=
0.0
;
static
float
t2down_C
=
0.0
;
static
int
nachKommaStellen
=
1
;
mp3Loop
();
if
(
checkButton
()
==
LOW
)
{
displayLight
(
true
);
sayInfos
(
t1up_C
,
t1down_C
,
t2up_C
,
t2down_C
,
nachKommaStellen
);
sayInfos
(
t1up_C
,
t1down_C
,
t2up_C
,
t2down_C
);
}
else
{
displayLight
(
false
);
}
...
...
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