Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AOT Praktikum - Messstation
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Operate
Terraform modules
Analyze
Contributor analytics
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
Philipp Florian Heisler
AOT Praktikum - Messstation
Commits
312148bb
Commit
312148bb
authored
7 months ago
by
Ariyosena Sutandang
Browse files
Options
Downloads
Patches
Plain Diff
release 1.0
parent
15962fca
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ESNS/ESNS.ino
+5
-9
5 additions, 9 deletions
ESNS/ESNS.ino
ESNS/rainSensor.ino
+8
-8
8 additions, 8 deletions
ESNS/rainSensor.ino
with
13 additions
and
17 deletions
ESNS/ESNS.ino
+
5
−
9
View file @
312148bb
...
...
@@ -28,6 +28,7 @@ void setup() {
void
loop
()
{
DEBUG_PRINTLN
(
"now: "
+
dateTimeToString
(
rtc_external
.
now
())
+
" alarm: "
+
dateTimeToString
(
next5MinuteAlarm
));
DEBUG_DELAY
(
1000
);
//hier ganze programm pausieren
checkForPausingPins
();
//only if LoRa works
...
...
@@ -106,22 +107,17 @@ void sleepUntil(DateTime targetTime) {
void
checkForPausingPins
()
{
while
(
digitalRead
(
unmountSDPin
)
==
LOW
)
{
digitalWrite
(
OnBoardLEDPin
,
HIGH
);
delay
(
500
);
digitalWrite
(
OnBoardLEDPin
,
LOW
);
SD
.
end
();
DEBUG_PRINT
(
"WARNING: UNMOUNT MODE!"
);
DEBUG_PRINTLN
(
"WARNING: UNMOUNT MODE!"
);
delay
(
1000
);
}
SD
.
begin
();
bool
changedHumidity
=
false
;
while
(
digitalRead
(
configmodePin
)
==
LOW
)
{
configHumidity
(
changedHumidity
);
changedHumidity
=
true
;
digitalWrite
(
OnBoardLEDPin
,
HIGH
);
DEBUG_PRINT
(
"WARNING: CONFIG MODE!"
);
delay
(
500
);
digitalWrite
(
OnBoardLEDPin
,
LOW
);
DEBUG_PRINTLN
(
"WARNING: CONFIG MODE!"
);
delay
(
1000
);
}
if
(
changedHumidity
)
{
...
...
This diff is collapsed.
Click to expand it.
ESNS/rainSensor.ino
+
8
−
8
View file @
312148bb
...
...
@@ -20,14 +20,14 @@ void saveRainMeasurement(String data) {
char
filename
[
22
];
DateTime
now
=
rtc_external
.
now
();
//String filePath;
if
(
!
SD
.
exists
(
String
(
id
).
c_str
()))
{
if
(
!
mkdirSD
(
String
(
id
)))
{
DEBUG_PRINTLN
(
"rain mkdir fail!"
);
return
;
}
else
{
DEBUG_PRINTLN
(
"rain mkdir success"
);
}
}
//
if (!SD.exists(String(id).c_str())) {
//
if (!mkdirSD(String(id))) {
//
DEBUG_PRINTLN("rain mkdir fail!");
//
return;
//
} else {
//
DEBUG_PRINTLN("rain mkdir success");
//
}
//
}
if
(
SD
.
begin
(
SD_PIN
))
{
sprintf
(
filename
,
"rain_%02d_%04d%02d.txt"
,
id
,
now
.
year
(),
now
.
month
());
...
...
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