pine64 SDK/library
#1
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.
#2
https://github.com/swkim01/RPi.GPIO-PineA64
#3
(05-28-2016, 07:38 AM)martinayotte Wrote: https://github.com/swkim01/RPi.GPIO-PineA64

Looks cool, could you maybe give a rough tutorial? Smile
#4
Excellent - many people asking about GPIO
You can find me on IRC, Discord and Twitter


#5
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()
#6
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?
#7
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)
#8
@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 = 71

You 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
#9
That's great news!
Thanks for sharing.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Wi-Fi/Bluetooth for PINE64, Model: Sopine A64 lamson 0 2,058 08-24-2021, 08:17 AM
Last Post: lamson
  AC Adapter Which One? Pine64 A64 DB V1.1 2GB REV B (Year 2016) databaseprogrammer 2 3,969 06-17-2021, 05:35 AM
Last Post: kqlnut
  Just discovered Pine64 ! - first Q philip_rhoades 4 6,550 04-29-2020, 10:13 AM
Last Post: tophneal
  A newest user in Pine64 Aliko 1 4,418 04-19-2020, 10:33 PM
Last Post: tllim
  PINE64 Installer - Simple Way to Image Your MicroSD pineadmin 101 164,839 01-15-2020, 12:46 PM
Last Post: tophneal
  Emails from pine64 received as spam by gmail Matan 2 6,545 08-21-2019, 08:30 AM
Last Post: Leiaz
  How to handle a Pine64 correctly gbjensen 6 17,452 03-28-2019, 11:43 PM
Last Post: InsideJob
Information Creating a NAS server in Pine64 javi_cala 4 9,011 01-21-2019, 02:03 AM
Last Post: bartes
  The 6 most common reasons why Pine64 won't boot Andrew2 109 227,607 10-11-2018, 11:35 PM
Last Post: Technolab88
  Pine64 installer way slow flashing Paraplegic Racehorse 2 5,058 01-10-2018, 04:05 PM
Last Post: dkryder

Forum Jump:


Users browsing this thread: 1 Guest(s)