Jump to content

Recommended Posts

Posted

OPi.GPIO uses the GPIO Sysfs Interface for Userspace. I worked with the author to add Nano Pi Duo pin mappings including the built in button. The obligatory LED flasher for Duo:

import time
import nanopi.duo
from OPi import GPIO

GPIO.setmode(nanopi.duo.BOARD)
GPIO.setwarnings(False)
GPIO.setup(7, GPIO.OUT)
GPIO.output(7, GPIO.HIGH)

count = 0
while count < 20:
    print(count)
    GPIO.output(7, GPIO.LOW)
    time.sleep(0.5)
    GPIO.output(7, GPIO.HIGH)
    time.sleep(0.5)
    count += 1
GPIO.cleanup()

 

Posted

I'm not able to find a RPi.GPIO like wrapper for libgpiod. This is essential to use a lot of Python code out there written against RPi.GPIO.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines