Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MessdatenSilo
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lennard Kloock
MessdatenSilo
Commits
431e9356
Commit
431e9356
authored
3 years ago
by
Lennard
Browse files
Options
Downloads
Patches
Plain Diff
Fix #1
parent
7a3a521b
No related branches found
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/serial_id.py
+15
-0
15 additions, 0 deletions
scripts/serial_id.py
scripts/write.bash
+12
-2
12 additions, 2 deletions
scripts/write.bash
with
27 additions
and
2 deletions
scripts/serial_id.py
0 → 100644
+
15
−
0
View file @
431e9356
"""
Return the id of the arduino connected to the first serial port. id 0 is for Temperaturmessung, id 1 for DMSMessung
"""
import
time
import
serial
if
__name__
==
"
__main__
"
:
with
serial
.
Serial
(
"
/dev/ttyACM0
"
,
9600
,
timeout
=
3
)
as
con
:
while
True
:
con
.
write
(
1
)
try
:
print
(
int
(
con
.
readline
().
decode
(
"
utf-8
"
)))
break
except
(
TypeError
,
ValueError
):
time
.
sleep
(
1
)
This diff is collapsed.
Click to expand it.
scripts/write.bash
+
12
−
2
View file @
431e9356
...
@@ -4,9 +4,19 @@ cd `dirname "$0"`/../sketches
...
@@ -4,9 +4,19 @@ cd `dirname "$0"`/../sketches
fqbn
=
arduino:avr:nano
fqbn
=
arduino:avr:nano
core
=
arduino:avr
core
=
arduino:avr
id
=
$(
python3 ../scripts/serial_id.py
)
if
[[
$id
!=
"0"
]]
then
serial_dms
=
/dev/ttyACM0
serial_dms
=
/dev/ttyACM0
serial_temp
=
/dev/ttyACM1
serial_temp
=
/dev/ttyACM1
else
serial_temp
=
/dev/ttyACM0
serial_dms
=
/dev/ttyACM1
fi
echo
-e
"Info: DMS arduino:
$serial_dms
, Temp arduino:
$serial_temp
"
echo
"Checking connected devices..."
echo
"Checking connected devices..."
...
...
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