View: 136612|Reply: 143

GPIO library - WiringPi

[Copy link]

1

threads

6

posts

23

credits

Novice

Rank: 1

credits
23
Published in 2015-3-12 04:42:34 | Show all floors |Read mode
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

1

threads

20

posts

122

credits

Registered member

Rank: 2

credits
122
Published in 2015-8-16 21:47:26 | Show all floors
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

  1. modprobe gpio-sunxi
Copy code


I can see the folders: /sys/class/gpio_sw/

Then I can switch on/off the led of the board with:

  1. echo 1 > /sys/class/gpio_sw/normal_led/data
  2. echo 0 > /sys/class/gpio_sw/normal_led/data
  3. echo 1 > /sys/class/gpio_sw/standby_led/data
  4. echo 0 > /sys/class/gpio_sw/standby_led/data
Copy code


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:

  1. echo 0 > /sys/class/gpio_sw/PA1/data
Copy code
  1. echo 1 > /sys/class/gpio_sw/PA1/data
Copy code

Edit:
And I just manage to move a servo motor with a little php script...


Finally did it :-D

Have fun ;-)


2

threads

19

posts

110

credits

Registered member

Rank: 2

credits
110
Published in 2016-3-8 01:28:30 from mobile | Show all floors
why dont you just install armbian

18

threads

303

posts

9909

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
9909
Published in 2015-10-30 11:50:03 | Show all floors

WiringOP a GPIO library for Oangepi PC/ Plus is released for testing. Click link below.Click HERE




2

threads

144

posts

1104

credits

Gold member

Rank: 6Rank: 6

credits
1104
Published in 2016-2-12 18:18:09 | Show all floors
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!

2

threads

144

posts

1104

credits

Gold member

Rank: 6Rank: 6

credits
1104
Published in 2016-2-17 19:05:38 | Show all floors
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.

2

threads

144

posts

1104

credits

Gold member

Rank: 6Rank: 6

credits
1104
Published in 2016-2-17 00:51:09 | Show all floors
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.

12

threads

99

posts

375

credits

Intermediate member

Rank: 3Rank: 3

credits
375
Published in 2016-2-16 21:32:39 | Show all floors
digitalRead() doesn't work?

0

threads

12

posts

132

credits

Registered member

Rank: 2

credits
132
Published in 2015-10-9 17:13:16 | Show all floors
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.



This thread contains more resources

You need to Log in to download or view,No account?    Register

x

11

threads

75

posts

376

credits

Intermediate member

Rank: 3Rank: 3

credits
376
Published in 2015-8-16 17:40:07 | Show all floors
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 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)

1

threads

20

posts

122

credits

Registered member

Rank: 2

credits
122
Published in 2015-8-17 03:43:22 | Show all floors
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
Published in 2015-3-12 05:07:48 | Show all floors
Sorry. We will release raspbian in a week. Please wait.

1

threads

6

posts

23

credits

Novice

Rank: 1

credits
23
 Author| Published in 2015-3-12 05:31:00 | Show all floors
Ok, great. I am currently using igorpec's debian wheezy. Working like a charm!
Published in 2015-3-12 06:12:43 | Show all floors
Thank igorpec's work.

0

threads

2

posts

22

credits

Novice

Rank: 1

credits
22
Published in 2015-3-15 17:52:20 | Show all floors
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.

0

threads

2

posts

22

credits

Novice

Rank: 1

credits
22
Published in 2015-3-21 03:08:23 | Show all floors
Anyone? ;)
Reply

Use magic report

1

threads

6

posts

23

credits

Novice

Rank: 1

credits
23
 Author| Published in 2015-3-21 04:24:31 | Show all floors
Edited by linga51 at 2015-3-21 04:57

GPIO is now working in the Raspbian image.

0

threads

5

posts

45

credits

Novice

Rank: 1

credits
45
Published in 2015-5-12 21:42:54 | Show all floors
What about GPIO on Orange Pi Plus?

1

threads

3

posts

61

credits

Registered member

Rank: 2

credits
61
Published in 2015-7-15 21:15:55 | Show all floors
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.

11

threads

75

posts

376

credits

Intermediate member

Rank: 3Rank: 3

credits
376
Published in 2015-7-16 08:40:54 | Show all floors
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/...

This thread contains more resources

You need to Log in to download or view,No account?    Register

x
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list