Using GPIO pins
#7
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


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/
  Reply


Messages In This Thread
Using GPIO pins - by smartdave - 08-17-2018, 12:22 PM
RE: Using GPIO pins - by mcerveny - 08-19-2018, 11:14 AM
RE: Using GPIO pins - by smartdave - 08-19-2018, 06:24 PM
RE: Using GPIO pins - by mcerveny - 08-20-2018, 07:52 AM
RE: Using GPIO pins - by smartdave - 08-20-2018, 08:03 AM
RE: Using GPIO pins - by smartdave - 08-21-2018, 04:12 PM
RE: Using GPIO pins - by Bullet64 - 09-20-2018, 04:53 AM
RE: Using GPIO pins - by smartdave - 09-20-2018, 05:42 AM
RE: Using GPIO pins - by Bullet64 - 09-20-2018, 06:05 AM
RE: Using GPIO pins - by Bullet64 - 09-20-2018, 07:27 AM
RE: Using GPIO pins - by Mrfixit2001 - 10-03-2018, 11:55 AM
RE: Using GPIO pins - by Bullet64 - 10-03-2018, 12:46 PM
RE: Using GPIO pins - by {-DesT-} - 02-08-2021, 01:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  setting permissions on gpio baraqiyal 0 1,343 08-16-2022, 11:37 AM
Last Post: baraqiyal
  No Hardware Interrupts for GPIO pantera 2 5,319 05-08-2021, 10:16 AM
Last Post: Badger
  RockPro64 Fan Pins TheUnknownMuncher 7 11,441 11-14-2019, 04:06 AM
Last Post: vecnar
  SPI support in GPIO mr_rabbit 2 4,807 07-21-2019, 11:42 PM
Last Post: Wom the Bat
  DSI connector is 30 pins NOT 32 ( be aware) AmroIb 3 5,462 05-25-2019, 06:15 AM
Last Post: dukla2000
  UART pins and settings for ROCKPRO64 frewind 2 5,637 07-27-2018, 03:25 PM
Last Post: frewind

Forum Jump:


Users browsing this thread: 3 Guest(s)