Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pls-pnv
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
plaasio
pls-pnv
Commits
f1691a31
Commit
f1691a31
authored
Jan 29, 2020
by
plaasio
👷🏽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update btns.py
parent
2c7613ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
btns.py
btns.py
+8
-8
No files found.
btns.py
View file @
f1691a31
import
RPi.GPIO
as
GPIO
# Import Raspberry Pi GPIO library
import
asyncio
print
(
"pressing"
)
async
def
mon
(
x
)
return
"hi"
try
:
async
def
speak_async
():
GPIO
.
setwarnings
(
False
)
# Ignore warning for now
await
def
(
"1"
)
GPIO
.
setmode
(
GPIO
.
BOARD
)
# Use physical pin numbering
...
...
@@ -27,5 +23,9 @@ try:
if
GPIO
.
input
(
18
)
==
GPIO
.
HIGH
:
print
(
"yes"
)
break
finally
:
GPIO
.
cleanup
()
loop
=
asyncio
.
get_event_loop
()
loop
.
run_until_complete
(
speak_async
())
GPIO
.
cleanup
()
loop
.
close
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment