How to control the GPIO using python in Banana Pi Zero?


(Ram) #1

Hi All

I am trying to turn on a small led using python script.

As we do in Raspberry Pi- Code —> import time import RPi.GPIO as GPIO

========== I have the problem with
import RPi.GPIO as GPIO
How I will write for the BPI zero.

Thanks


(ZB) #2

Hello, We have built-in some commands in image, could you find “xxx.py” in “/usr/local/bin”?


(Ram) #3

Hi Thanks for your response.

I have not found any .py file in /usr/loca/bin

Here is the output…

so can you send me small python code for led on and off with importing headers file and all.

Thanks


(ZB) #4

Hello,you can see here :https://github.com/BPI-SINOVOIP/RPi.GPIO

find example in test directory.


(berbec) #5

For those who find the above RPi.GPIO library, i’ve had issues

Building the library requires a file called “board.sh” which lets the library identify which Banana is in use. This file does not exist on any image I have downloaded. I would really like to find this file


(ZB) #6

Hello, try this way please, the install method is same with M3: http://wiki.banana-pi.org/Getting_Started_with_M3#RPi.GPIO