12
Return to list Post new posts
Author: coscos

WiringOP for Orange pi zero

[Copy link]

0

threads

3

posts

20

credits

Novice

Rank: 1

credits
20
Published in 2017-2-25 11:50:00 | Show all floors
gailu replied at 2017-2-17 21:31
Got the difference between OPI PC and OPI Zero mapping. Its working fine now.

Any chance you would share that info? I'm having the same issue.

0

threads

3

posts

20

credits

Novice

Rank: 1

credits
20
Published in 2017-2-26 07:31:17 | Show all floors
Edited by sb17joker at 2017-2-25 17:38

ok, figured out most of it, and updated readall.c, pins 19, and 21 still haven't figured out... but...


This thread contains more resources

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

x

5

threads

6

posts

29

credits

Novice

Rank: 1

credits
29
Published in 2017-3-6 06:03:03 | Show all floors
can someone explain how to map wiringPO on zero plaese?

10

threads

218

posts

2040

credits

Gold member

Rank: 6Rank: 6

credits
2040
Published in 2017-3-15 08:51:24 | Show all floors
Edited by nopnop2002 at 2017-3-15 11:24
diyer replied at 2017-3-6 06:03
can someone explain how to map wiringPO on zero plaese?

Please use WiringOP-ZERO

https://github.com/xpertsavenue/WiringOP-Zero

It have compatibility of the pin number.
But if you operate GPIO using device file,ZERO don't have compatibility to OPI-PC.

You can know this difference in [gpio readall] command.

Operate Pin#18 with OPI-PC

$ sudo sh -c "echo 71 >/sys/class/gpio/export"
$ sudo sh -c "echo out >/sys/class/gpio/gpio71/direction"
$ sudo sh -c "echo 1 > /sys/class/gpio/gpio71/value"
$ sudo sh -c "echo 0 > /sys/class/gpio/gpio71/value"
$ sudo sh -c "echo 71 > /sys/class/gpio/unexport"


Operate Pin#18 with ZERO


$ sudo sh -c "echo 18 >/sys/class/gpio/export"
$ sudo sh -c "echo out >/sys/class/gpio/gpio18/direction"
$ sudo sh -c "echo 1 > /sys/class/gpio/gpio18/value"
$ sudo sh -c "echo 0 > /sys/class/gpio/gpio18/value"
$ sudo sh -c "echo 18 > /sys/class/gpio/unexport"







10

threads

218

posts

2040

credits

Gold member

Rank: 6Rank: 6

credits
2040
Published in 2017-3-15 10:15:09 | Show all floors
Edited by nopnop2002 at 2017-3-15 11:50
diyer replied at 2017-3-6 06:03
can someone explain how to map wiringPO on zero plaese?

In case of Python, you can use there library.

orangepi_PC_gpio_pyH3
https://github.com/duxingkei33/orangepi_PC_gpio_pyH3

WiringPi-Python-OP
https://github.com/lanefu/WiringPi-Python-OP

But there library pin assin is not same.

In case orangepi_PC_gpio_pyH3.
PysPin PinInLib
1(3.3V)
2(5V)
3      12
4(5V)
5      11
6(GND)
7      6
8      198
9(GND)
10     199
11     1
12     7
13     0
14(GND)
15     3
16     19
17(3.3V)
18     18
19     15
20(GND)
21     16
22     2
23     14
24     13
25(GND)
26     10

  1. # -*- coding: utf-8 -*-
  2. from pyA20.gpio import gpio
  3. from pyA20.gpio import port
  4. import time
  5. import sys

  6. PIN = port.PA10

  7. argvs = sys.argv
  8. argc = len(argvs)

  9. if (argc == 2):
  10.   PIN = int(argvs[1])

  11. print "PIN=",PIN
  12. gpio.init()
  13. gpio.setcfg(PIN, gpio.OUTPUT)

  14. for _ in xrange(5):
  15.     gpio.output(PIN,True)
  16.     time.sleep(1.0)
  17.     gpio.output(PIN,False)
  18.     time.sleep(1.0)
Copy code


In case WiringPi-Python-OP.
PysPin PinInLib
1(3.3V)
2(5V)
3      8
4(5V)
5      9
6(GND)
7      7
8      28
9(GND)
10     29
11     0
12     21
13     2
14(GND)
15     3
16     30
17(3.3V)
18     31
19     Can't USE
20(GND)
21     Can't USE
22     6
23     16
24     15
25(GND)
26     24

  1. # -*- coding: utf-8 -*-
  2. import wiringpi
  3. import time
  4. import sys

  5. OUTPUT = 1
  6. HIGH = 1
  7. LOW = 0
  8. PIN = 15

  9. argvs = sys.argv
  10. argc = len(argvs)

  11. if (argc == 2):
  12.   PIN = int(argvs[1])

  13. print "PIN=",PIN
  14. wiringpi.wiringPiSetup()
  15. wiringpi.pinMode(PIN,OUTPUT)
  16. wiringpi.digitalWrite(PIN,LOW)
  17. for _ in xrange(5):
  18.   wiringpi.digitalWrite(PIN,HIGH)
  19.   time.sleep(1)
  20.   wiringpi.digitalWrite(PIN,LOW)
  21.   time.sleep(1)
Copy code

10

threads

218

posts

2040

credits

Gold member

Rank: 6Rank: 6

credits
2040
Published in 2017-3-15 14:55:23 | Show all floors
Edited by nopnop2002 at 2017-3-18 22:51
diyer replied at 2017-3-6 06:03
can someone explain how to map wiringPO on zero plaese?

You can update WiringPi-Python-OP to WiringPi-Python-OP-ZERO.

1.Download [WiringOP libary for the Orange Pi Zero] from here.

https://github.com/xpertsavenue/WiringOP-Zero

2.Download [WiringPi-Python-OP] from here.(But not Install)

https://github.com/lanefu/WiringPi-Python-OP

3.Replace base library

cd WiringPi-Python-OP
rm -R WiringPi
cp -R $HOME/WiringOP-Zero ./
mv WiringOP-Zero WiringPi

4.Build WiringPi-Python-OP-ZERO library

sudo apt-get install python-dev python-setuptools swig
swig2.0 -python wiringpi.i
sudo python setup.py install
cd tests
sudo python test.py

WiringPi-Python-OP-ZERO have there pin.
PysPin PinInLib
1(3.3V)
2(5V)
3      8
4(5V)
5      9
6(GND)
7      7
8      15
9(GND)
10     16
11     0
12     1
13     2
14(GND)
15     3
16     4
17(3.3V)
18     5
19     12
20(GND)
21     13
22     6
23     14
24     10
25(GND)
26     11

This is same as RPI TYPE A or B



0

threads

3

posts

20

credits

Novice

Rank: 1

credits
20
Published in 2017-3-19 10:25:19 | Show all floors
Thanks for your help nopnop2002

6

threads

9

posts

150

credits

Registered member

Rank: 2

credits
150
Published in 2018-2-14 20:47:58 | Show all floors
https://descubriendolaorangepi.w ... -libreria-wiringop/   At link there are github links  for H3,  H5, H2 .

0

threads

4

posts

25

credits

Novice

Rank: 1

credits
25
Published in 2018-3-28 08:18:11 | Show all floors
for orange pi zero I found this

https://github.com/xpertsavenue/WiringOP-Zero

1

threads

3

posts

17

credits

Novice

Rank: 1

credits
17
Published in 2018-6-25 16:34:06 | Show all floors
Edited by BobbyBalsa at 2018-6-25 16:37

this one works for the zero , out of the box :OPI-zero

and a nice tutorial , in German :
OPi zero first steps



12
Return to list Post new posts
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list