Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 80000|Reply: 144

GPIO library - WiringPi

[Copy link]

1

Threads

6

Posts

23

Credits

Novice

Rank: 1

Credits
23
Post time 2015-3-12 04:42:34 | Show all posts |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

0

Threads

19

Posts

111

Credits

Registered member

Rank: 2

Credits
111
Post time 2015-8-16 21:47:26 | Show all posts
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 the 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 the 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 the Code
  1. echo 1 > /sys/class/gpio_sw/PA1/data
Copy the 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
Post time 2016-3-8 01:28:30 From the mobile phone | Show all posts
why dont you just install armbian

18

Threads

303

Posts

7753

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
7753
Post time 2015-10-30 11:50:03 | Show all posts

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




2

Threads

144

Posts

871

Credits

Senior member

Rank: 4

Credits
871
Post time 2016-2-12 18:18:09 | Show all posts
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

871

Credits

Senior member

Rank: 4

Credits
871
Post time 2016-2-17 19:05:38 | Show all posts
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

871

Credits

Senior member

Rank: 4

Credits
871
Post time 2016-2-17 00:51:09 | Show all posts
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
Post time 2016-2-16 21:32:39 | Show all posts
digitalRead() doesn't work?

0

Threads

12

Posts

132

Credits

Registered member

Rank: 2

Credits
132
Post time 2015-10-9 17:13:16 | Show all posts
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 post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x

11

Threads

75

Posts

376

Credits

Intermediate member

Rank: 3Rank: 3

Credits
376
Post time 2015-8-16 17:40:07 | Show all posts
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)

0

Threads

19

Posts

111

Credits

Registered member

Rank: 2

Credits
111
Post time 2015-8-17 03:43:22 | Show all posts
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
Post time 2015-3-12 05:07:48 | Show all posts
Sorry. We will release raspbian in a week. Please wait.

1

Threads

6

Posts

23

Credits

Novice

Rank: 1

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

0

Threads

2

Posts

22

Credits

Novice

Rank: 1

Credits
22
Post time 2015-3-15 17:52:20 | Show all posts
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
Post time 2015-3-21 03:08:23 | Show all posts
Anyone? ;)

1

Threads

6

Posts

23

Credits

Novice

Rank: 1

Credits
23
 Author| Post time 2015-3-21 04:24:31 | Show all posts
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
Post time 2015-5-12 21:42:54 | Show all posts
What about GPIO on Orange Pi Plus?

1

Threads

3

Posts

61

Credits

Registered member

Rank: 2

Credits
61
Post time 2015-7-15 21:15:55 | Show all posts
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
Post time 2015-7-16 08:40:54 | Show all posts
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 post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x
You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2019-12-13 06:10 GMT+8 , Processed in 0.043149 second(s), 24 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list