Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Serial Communication Arduino
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
GRASP
Serial Communication Arduino
Commits
70e110a0
Commit
70e110a0
authored
3 years ago
by
Ilona Szczot
Browse files
Options
Downloads
Patches
Plain Diff
Modified communication from PC. We dont need vacuum anymore
parent
5b607086
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
send2arduino.py
+7
-7
7 additions, 7 deletions
send2arduino.py
with
7 additions
and
7 deletions
send2arduino.py
+
7
−
7
View file @
70e110a0
...
...
@@ -2,7 +2,7 @@ import serial
import
time
# max 1024
TEST_VALUE
=
100
TEST_VALUE
=
100
0
# a very low value to pull in an unnoticable way
REST_VALUE
=
1
SLEEP_SEC
=
5
...
...
@@ -21,12 +21,12 @@ try:
my_serial
.
write
(
arg
)
# hold that value for SLEEP_SEC
time
.
sleep
(
SLEEP_SEC
)
# release by sending negative value
arg
=
bytes
(
str
(
int
(
-
TEST_VALUE
)),
'
utf8
'
,
'
ignore
'
)
+
b
'
\r
'
# send to arduino serial
my_serial
.
write
(
arg
)
# hold that value for SLEEP_SEC
time
.
sleep
(
SLEEP_SEC
)
#
#
release by sending negative value
#
arg = bytes(str(int(-TEST_VALUE)), 'utf8','ignore') + b'\r'
#
#
send to arduino serial
#
my_serial.write(arg)
#
#
hold that value for SLEEP_SEC
#
time.sleep(
2
)
# negative creates constant vacuum and that overheats one part
# therefore, send very low value to pull in an unnoticable way
arg
=
bytes
(
str
(
int
(
REST_VALUE
)),
'
utf8
'
,
'
ignore
'
)
+
b
'
\r
'
...
...
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