View: 7655|Reply: 67

OPi.GPIO error

[Copy link]

9

threads

12

posts

117

credits

Registered member

Rank: 2

credits
117
Published in 2023-6-9 05:52:20 | Show all floors |Read mode
i am using a orange pi 3 lts and i want to use my gpio pins and i do a nano ledBlink.py and then i do small program useing the OPi.GPİO library and i write a program that just turns HIGH AND LOW 4 time but i keep geting this error it i been trying to fix this error for over a 4 months but i can fix it i would be very happy if one help me and know there is PYa20 library i can also use but i realy want to use OPi.GPIO  
import OPi.GPIO as GPIO here is the ledBlink program import time                                                                                                                GPIO.setmode(GPIO.BOARD)LED_PIN = 7GPIO.setwarnings(False)GPIO.setup(LED_PIN, GPIO.OUT)try:    while True:        GPIO.output(LED_PIN, GPIO.TRUE)        time.sleep(1)        GPIO.output(LED_PIN, GPIO.FALSE)        time.sleep(1)except KeyboardInterrupt:                                                                                                         GPIO.cleanup()


  File "ledBlink.py", line 7, in <module>    GPIO.setup(LED_PIN, GPIO.OUT)  File "/usr/local/lib/python3.7/site-packages/OPi.GPIO-0.5.3-py3.7.egg/OPi/GPIO.py", line 482, in setup    sysfs.direction(pin, direction)  File "/usr/local/lib/python3.7/site-packages/OPi.GPIO-0.5.3-py3.7.egg/OPi/sysfs.py", line 56, in direction    fp.write("out")OSError: [Errno 22] Invalid argumentyusufsait@orangepi3-lts:~$                                        and here is the error

1

threads

3

posts

21

credits

Novice

Rank: 1

credits
21
Published in 2023-6-10 23:58:54 | Show all floors

I am a newer on Orange Pi 5 and do not own an Orange Pi 3.
Please reference to: https://github.com/orangepi-xunlong/wiringOP
But code in above web page dose not support Orange Pi 5 at this moment.
Therefor, I modified your code as below and have no test.
Hope these information can help you.


import OPi.GPIO as GPIO  # here is the led Blink program
import time

GPIO.setboard(GPIO.OPi3)
GPIO.setmode(GPIO.BOARD)
LED_PIN = 7
#GPIO.setwarnings(False)

GPIO.setup(LED_PIN, GPIO.OUT)
try:
    while True:
        GPIO.output(LED_PIN, 1)
        time.sleep(1)
        GPIO.output(LED_PIN, 0)
        time.sleep(1)
        
except KeyboardInterrupt:
    GPIO.output(LED_PIN, 0)
    GPIO.cleanup()



9

threads

12

posts

117

credits

Registered member

Rank: 2

credits
117
 Author| Published in 2023-6-11 22:46:18 | Show all floors
thank you have a lovely day
Published in 2025-7-3 15:32:47 | Show all floors
An intriguing discussion may be worth comment. I do think that you should write regarding this topic, may possibly not often be a taboo subject but usually people are there are not enough to dicuss on such topics. To a higher. Cheers        bokep indonesia
Published in 2025-7-3 19:51:54 | Show all floors
I should test with you here. Which isn’t something I normally do! I enjoy reading a put up that may make people think. Also, thanks for permitting me to remark!        บาคาร่า88
Published in 2025-7-3 20:08:17 | Show all floors
Simply wanna input on few general things, The website layout is perfect, the subject matter is really wonderful : D.        new88
Published in 2025-7-3 21:45:41 | Show all floors
You have  noted  very interesting  details ! ps nice   website  .        sbobet777 login
Published in 2025-7-4 19:58:03 | Show all floors
I like the many blogposts, I seriously liked, I want details about it, since it is rather wonderful., Cheers pertaining to expressing.        kingthai999
Published in 2025-7-7 18:50:43 | Show all floors
How can i extend the range of a Wireless N router? I have an Xtreme N handheld router (Dlink). I have to extend the reach in the wireless signal. I know how to do it for the G signal. I want to know how to do the idea for an N sign. Is it possible make use of regular N routers as repeaters. If so, how to configure them. Thanks for that information.        789bet
Published in 2025-7-7 20:29:01 | Show all floors
Eh oui et aussi pas vraiment. Certes en effet on détermine de nouvelles sources qui se référent les memes significations. Non étant donné que il n’est pas suffisant de répéter ce que tout le monde est en mesure de voir chez certains sites tiers puis le traduire tant simplement?        hb88
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list