This website works better with JavaScript.
Home
Explore
Help
Sign In
Mobile-Devices-ITM
/
gpio-python
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Projects
0
Releases
0
Wiki
Activity
Browse Source
testing code
master
Demo User
8 months ago
commit
fa36af2d2d
2 changed files
with
24 additions
and
0 deletions
Unified View
Diff Options
Show Stats
Download Patch File
Download Diff File
+13
-0
gpio-test.py
+11
-0
gpio.py
+ 13
- 0
gpio-test.py
View File
@ -0,0 +1,13 @@
#!/usr/bin/python
import
sys
GPIO
=
"
/sys/class/gpio/gpio11
"
fo
=
open
(
GPIO
+
"
/direction
"
,
"
w
"
)
fo
.
write
(
"
out
"
)
fo
=
open
(
GPIO
+
"
/value
"
,
"
w
"
)
fo
.
write
(
"
0
"
)
fo
=
open
(
GPIO
+
"
/value
"
,
"
r
"
)
read
=
fo
.
read
(
)
print
(
read
)
+ 11
- 0
gpio.py
View File
@ -0,0 +1,11 @@
import
sys
GPIO
=
"
/sys/class/gpio/gpio11
"
def
write
(
)
:
fo
=
open
(
GPIO
+
"
/direction
"
,
"
w
"
)
fo
.
write
(
"
out
"
)
fo
=
open
(
GPIO
+
"
/value
"
,
"
w
"
)
fo
.
write
(
"
1
"
)
fo
=
open
(
GPIO
+
"
/value
"
,
"
r
"
)
read
=
fo
.
read
(
)
print
(
read
)
Write
Preview
Loading…
Cancel
Save