09-20-2018, 04:53 AM
Thanks smartdave for your work.
What I do not understand? How do I get the numbers out? http://files.pine64.org/doc/rockpro64/Ro...ver0.2.png
My script
More infos here -> https://forum.frank-mankel.org/topic/292...-rp64-gpio (sry, only german)
What I do not understand? How do I get the numbers out? http://files.pine64.org/doc/rockpro64/Ro...ver0.2.png
My script
Code:
#!/usr/bin/env python
# Frank Mankel, 2018, LGPLv3 License
# Rock 64 GPIO Library for Python
# Thanks Allison! Thanks smartdave!
import R64.GPIO as GPIO
from time import sleep
print("Output Test R64.GPIO Module...")
# Set Variables
var_gpio_out = 52
#var_gpio_in = 18
# GPIO Setup
GPIO.setwarnings(True)
GPIO.setmode(GPIO.ROCK)
GPIO.setup(var_gpio_out, GPIO.OUT, initial=GPIO.HIGH) # Set up GPIO as an output, with an initial state of HIGH
#GPIO.setup(var_gpio_in, GPIO.IN, pull_up_down=GPIO.PUD_UP) # Set up GPIO as an input, pullup enabled
# Test Output
print("")
print("Testing GPIO Input/Output:")
while True:
var_gpio_state = GPIO.input(var_gpio_out) # Return State of GPIO
if var_gpio_state == str(0):
GPIO.output(var_gpio_out,1) # Set GPIO to LOW
print("Output State IF : " + str(var_gpio_state)) # Print results
else:
GPIO.output(var_gpio_out,0) # Set GPIO to LOW
print("Output State ELSE: " + str(var_gpio_state))
sleep(0.5)
exit()
More infos here -> https://forum.frank-mankel.org/topic/292...-rp64-gpio (sry, only german)
Sorry for any mistakes. English is not my native language
1. Quartz64 Model B, 4GB RAM
2. Quartz64 Model A, 4GB RAM
3. RockPro64 v2.1
https://linux-nerds.org/
1. Quartz64 Model B, 4GB RAM
2. Quartz64 Model A, 4GB RAM
3. RockPro64 v2.1
https://linux-nerds.org/