05-27-2016, 09:14 PM
is there some library for pine64 like what Rpi has where you can read and write information to the io ports? I believe there is I just couldn't find it.
|
pine64 SDK/library
|
|
05-27-2016, 09:14 PM
is there some library for pine64 like what Rpi has where you can read and write information to the io ports? I believe there is I just couldn't find it.
05-28-2016, 07:38 AM
05-29-2016, 03:32 AM
(05-28-2016, 07:38 AM)martinayotte Wrote: https://github.com/swkim01/RPi.GPIO-PineA64 Looks cool, could you maybe give a rough tutorial?
05-29-2016, 05:58 AM
Excellent - many people asking about GPIO
05-29-2016, 08:25 AM
(This post was last modified: 05-29-2016, 08:26 AM by martinayotte.)
Here is a quick example of GPIO LED Blinker :
Code: import RPi.GPIO as GPIO
LED_PIN = 26
GPIO.setmode(GPIO.BCM)
GPIO.setup(LED_PIN, GPIO.OUT)
while 1:
GPIO.output(LED_PIN, GPIO.HIGH)
time.sleep(0.25)
GPIO.output(LED_PIN, GPIO.LOW)
time.sleep(0.25)
GPIO.cleanup()
Is modification of GPIO via /sys/class/gpio not supported?
I'm trying to setup GPIO 17 as an output. I can successfully export 17 as a GPIO, but then when I go to that directory ("gpio17") and try to set its direction, I get "Unknown error 517". I only have a couple GPIO that I need to use, so I'm wondering if the whole library is worth it, but if there's no other way...maybe I'll have to use it?
05-29-2016, 04:43 PM
(This post was last modified: 05-29-2016, 04:45 PM by martinayotte.)
You're right ! It seems that there is an issue there.
When I get chance, I will try to investigate ... (In the mean time, you should probably use the Python library from https://github.com/swkim01/RPi.GPIO-PineA64)
05-30-2016, 10:20 AM
(This post was last modified: 05-30-2016, 10:23 AM by martinayotte.)
@adamw,
Doing some searches, I found out the cause of the issue : since awhile, the pin numbering scheme in /sys/class/gpio has changed ! See : http://linux-sunxi.org/GPIO#Accessing_th...ine_kernel Also, here on the forum : http://forum.pine64.org/showthread.php?t...00#pid4000 On Pine64, the GPIO17 is attached to PC7, so, for the /sys/class/gpio, the numbering would be : Code: ('C' - 'A') * 32 + 7
or
2 * 32 + 7 = 71You can now give it a try with : Code: echo "71" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio71/direction
echo 1 > /sys/class/gpio/gpio71/value
05-30-2016, 10:48 AM
That's great news!
Thanks for sharing. |