GPIO library - WiringPi
Hi,I would like to use the GPIO library as described on the wiki:
http://www.orangepi.org/Docs/WiringPi.html
But I run into some problems when trying to clone the repository:
orangepi@orangepi:~$ git clone https://github.com/orangepi-xunlong/WiringOP -b orangepi
Cloning into 'WiringOP'...
Username for 'https://github.com': linga
Password for 'https://linga@github.com':
error: The requested URL returned error: 403 while accessing https://github.com/orangepi-xunlong/WiringOP/info/refs
fatal: HTTP request failed
When I look up https://github.com/orangepi-xunlong/WiringOP there is a 404
While the site https://github.com/orangepi-xunlong is working but has 0 public repositories.
Can anyone help me?
Best, Patrick Edited by alexparadise at 2015-8-16 22:58
So apprently no need to re-compile the Kernel, you just have to activate the module gpio-sunxi.
On Lubuntu & Raspbian, if I run the commands
modprobe gpio-sunxi
I can see the folders: /sys/class/gpio_sw/
Then I can switch on/off the led of the board with:
echo 1 > /sys/class/gpio_sw/normal_led/data
echo 0 > /sys/class/gpio_sw/normal_led/data
echo 1 > /sys/class/gpio_sw/standby_led/data
echo 0 > /sys/class/gpio_sw/standby_led/data
Edit:
If you connect a led+transitor between the connector 6 (GND) and 11 (GPIO17??), you can switch on/off the LED with the command:
echo 0 > /sys/class/gpio_sw/PA1/dataecho 1 > /sys/class/gpio_sw/PA1/data
Edit:
And I just manage to move a servo motor with a little php script...
Finally did it :-D
Have fun ;-)
why dont you just install armbian meir replied at 2015-10-28 21:59
broken link.
WiringOP a GPIO library for Oangepi PC/ Plus is released for testing. Click link below.Click HERE
I am quite disappointed how little interest there is on these forums for actually making anything with OPis -- everyone's just trying to use them as cheap desktops, Kodi-players or emulator-systems and almost no one wants to actually use the GPIO-pins and the various buses they offer for anything and such everything interesting is just broken. I still haven't figured out how to use H/W PWM, either, and resorting to software-emulation of PWM sucks. Having to poll GPIO-pins for state-changes sucks, too, and is a horrible waste of clock-cycles. I'm also terribly bothered by the fact that Steven and the folks behind the OPis didn't bring out SDIO-pins and the likes out on the boards that don't have WiFi and/or eMMC -- the pins are there on the SoC and they're obviously not in use when there is no WiFi or eMMC, so there's no good reason not to bring them out for those folks who want to make use of them! Impressive replied at 2016-2-17 17:26
So, I tried to use pull-up and pull-down resistor in this C code, but it didn't work:
It's a LED
Be ...
Yeah, it seems there is a bug in the WiringOP - library. I have merged a fix for pull-up/pull-down in my git-repo, compile WiringOP from there and it should work.
Impressive replied at 2016-2-16 21:52
So, I tried the digitalRead(), prorgam compile d, but it didn't work. I think I need something else ...
You need to know whether you need a pull-up resistor or a pull-down resistor. If whatever you've connected to the pin is active on LOW then you need a pull-up, and if it's active on HIGH then you need a pull-down.
digitalRead() doesn't work? Edited by sauberpauli at 2015-10-9 17:16
I have adapted the wiringpi library (http://wiringpi.com/) to the Orange Pi PC.
Basic was the adaptation of https://github.com/LeMaker/WiringBP "banana pi pro" library.
Changes...
- 1. CPU from A20 to H3
- 2. Header Pinout
- 3. /dev/i2c device
- 4. gpio utility
Please test and check the version. :)
Edited by bhgv at 2015-8-16 17:41
alexparadise replied at 2015-8-15 21:55
@fritz I just tried out this WiringBP on Orange Pi2 with Rasbian OS and I still didnt manage to do a ...
> Do we have absolutely to use this wiringPi lib, is there not other ways to use GPIO?
> Anyhow, what ever way to play with the GPIO interface, we would be very happy to know how to :D I hope someone will find out how to deal with it...
if you look inside the code of wiringpi you will see it is just reading/writing from/to/dev/... unix devices. you can use the code of wiringpi as tutorial for yourself. it is not so hard.
(and you can do this without wiringpi lib)
Now my problem is to find out how to read from GPIO. There is no direction file...
I try as well to read from UART but no way to find /dev/ttyAMA0...
I am a bit lost.
So if someone know how to read data from GPIO, I would love to hear how to do it :D Sorry. We will release raspbian in a week. Please wait. Ok, great. I am currently using igorpec's debian wheezy. Working like a charm! Thank igorpec's work. Hi,
Is there a posibility to get WiringOP code somewhere? I've installed bananian and wanted to start with gpio, but got 404.
If you can, please share WiringOP again. Anyone? ;) Edited by linga51 at 2015-3-21 04:57
GPIO is now working in the Raspbian image. What about GPIO on Orange Pi Plus? How can I use GPIOs on my Orange PI under debian (shell, Phyton, C)?
I was looking for WiringOP lib at https://github.com/orangepi-xunlong/ but it does not contain it now. :( this is a old wiringPI lib from steven. it not completely adapted to H3 boards. but you can look its code and use what you need. it's only shell around standard reading/writing /dev/...