You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when i tried to run a test program in up wiki to test the board, it told me that " ValueError: Invalid GPIO pin specified"
I don't know what happened, so i think i need some help
error:
Traceback (most recent call last):
File "light.py", line 11, in <module>
pin = mraa.Gpio(pin_no,owner=False,raw=True)
File "/usr/lib/python2.7/dist-packages/mraa.py", line 1122, in __init__
this = _mraa.new_Gpio(pin, owner, raw)
ValueError: Invalid GPIO pin specified
and the code:
#!/usr/bin/python
import sys
import mraa
import time
# Use pin 7 by default
pin_no = 13
# Export the GPIO pin for use
pin = mraa.Gpio(pin_no,owner=False,raw=True)
# Small delay to allow udev rules to execute (necessary only on up)
time.sleep(0.1)
# Configure the pin direction
pin.dir(mraa.DIR_OUT)
# Loop
while True:
# Turn the LED on and wait for 0.5 seconds
pin.write(1)
time.sleep(0.5)
# Turn the LED off and wait for 0.5 seconds
pin.write(0)
time.sleep(0.5)
Besides, there is the GPIO list:
ls /sys/class/gpio/
export gpiochip228 gpiochip341 unexport
gpiochip225 gpiochip314 gpiochip414
And I also can not export more new pin in the folder, which confused me a lot and i think it may relate to my question.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi @Sterben1111, when using raw=True you need to specify the Linux sysfs number for the pin. Set it to False if you want to use the board pin number. You can also use the short form pin = mraa.Gpio(pin_no).
when i tried to run a test program in up wiki to test the board, it told me that " ValueError: Invalid GPIO pin specified"
I don't know what happened, so i think i need some help
and the code:
Besides, there is the GPIO list:
And I also can not export more new pin in the folder, which confused me a lot and i think it may relate to my question.
Thanks!
The text was updated successfully, but these errors were encountered: