Jump to content

RPi.GPIO replacement for Orange Pi Zero and Nano Pi Duo


sgjava

Recommended Posts

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()

 

Link to comment
Share on other sites

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

Important Information

Terms of Use - Privacy Policy - Guidelines