GPIO Module help...

Multi-platform modular music creation studio
Post Reply
stevie232323
Posts: 24
Joined: Sun Feb 11, 2018 5:04 pm

GPIO Module help...

Post by stevie232323 »

Hi lovely people.
Another question: I have my Riotboard GPIOs working on Linux Ubuntu. SYSFS is enabled. I can turn LEDs on and off using the terminal and the echo 1 > /sys/class/gpio etc etc commands...

Can someone please explain to me how the GPIO module works. I have seen the R-PI video but this is not an explanation. There isn't much in the docs...
I have tried setting the GPIO module output to on, have it connected from a drum synth on full volume and selected all the pins but no joy...
So please please some more help?? pleeeeeease?????
Thankyou again. xxxxxx
Steve.S
User avatar
NightRadio
Site Admin
Posts: 3944
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: GPIO Module help...

Post by NightRadio »

Please show a complete list of commands that you use to turn on/off the LED
stevie232323
Posts: 24
Joined: Sun Feb 11, 2018 5:04 pm

Re: GPIO Module help...

Post by stevie232323 »

OK. Heres an example of making pin 5 of the expansion port a GPIO output:
First I use Devmem2 to make the pin an output like so: "devmem2 0x20E009C w 0x05"
Then I make it available to the user (me) like so:

cd /sys/class/gpio

This command muxes the pin. Because I am using GPIO4_16 then I make the GPIO available by using the Linux naming convention for pins / peripherals:

GPIO4_IO16 maps to (4 - 1) * 32 + 16 = 112.

echo 112 > export

cd into its directory:
cd gpio112

Tell the pin its an output:
echo out > direction

and then tell it to either turn on or off:
And now, you can control state with :

echo 1 > value (high state, more or less 3.3V)

echo 0 > value (low state, more or less 0V)

Thats how I do it in terminal. Simple once you know how...
But why nothing from Sunvox?
I've tried using an amplifier module to boost the levels but still nothing..
User avatar
NightRadio
Site Admin
Posts: 3944
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: GPIO Module help...

Post by NightRadio »

echo 112 > export
I think this is the reason. GPIO module can't write to pin 112, because the maximum value is 64.
I will increase it in 1.9.4
stevie232323
Posts: 24
Joined: Sun Feb 11, 2018 5:04 pm

Re: GPIO Module help...

Post by stevie232323 »

ohhhhhhh THANKYOU Nightradio.... я люблю тебя . x
Post Reply