|
Edited by nopnop2002 at 2017-3-15 11:50
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
- # -*- coding: utf-8 -*-
- from pyA20.gpio import gpio
- from pyA20.gpio import port
- import time
- import sys
- PIN = port.PA10
- argvs = sys.argv
- argc = len(argvs)
- if (argc == 2):
- PIN = int(argvs[1])
- print "PIN=",PIN
- gpio.init()
- gpio.setcfg(PIN, gpio.OUTPUT)
- for _ in xrange(5):
- gpio.output(PIN,True)
- time.sleep(1.0)
- gpio.output(PIN,False)
- 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
- # -*- coding: utf-8 -*-
- import wiringpi
- import time
- import sys
- OUTPUT = 1
- HIGH = 1
- LOW = 0
- PIN = 15
- argvs = sys.argv
- argc = len(argvs)
- if (argc == 2):
- PIN = int(argvs[1])
- print "PIN=",PIN
- wiringpi.wiringPiSetup()
- wiringpi.pinMode(PIN,OUTPUT)
- wiringpi.digitalWrite(PIN,LOW)
- for _ in xrange(5):
- wiringpi.digitalWrite(PIN,HIGH)
- time.sleep(1)
- wiringpi.digitalWrite(PIN,LOW)
- time.sleep(1)
Copy code
|
|