Jump to content

Ubuntu: How do I use gpio pins 21.04 (can I just use bash?)?

Helpful Tech Witch

Im working on a "case" for my rpi4 8gb. Its running ubuntu, because, I know how to use it, but also most server stuff i can find for rpi is ubuntu.

I want to bassically create a script (hopefully in bash, i know how to use it) that i can have automatically start with ubuntu, and have one gpio pin turn on, and a diffrent one turn on for one second, off for another, forever (thoretically)

but I have no idea how to do any of that. at all.

Wheres a good place to start?

 

I could use some help with this!

please, pm me if you would like to contribute to my gpu bios database (includes overclocking bios, stock bios, and upgrades to gpus via modding)

Bios database

My beautiful, but not that powerful, main PC:

prior build:

Spoiler

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Because of your question i became curious myself too.
I wnt to use the RPI4 i have connected to my TV to be able to change the RGB on my TV ledstrip.

I have been looking here: https://medium.com/coinmonks/controlling-raspberry-pi-gpio-pins-from-bash-scripts-traffic-lights-7ea0057c6a90

 

But having a very small grasp of how BASH works or what it can do i'm a bit stuck. Maybe this link can help you tho. (I got a buddy coming over to look at it so thats fine).

It does pertain to another Linux ditro but it looks like the commands should work among other Linux distro's?

When i ask for more specs, don't expect me to know the answer!
I'm just helping YOU to help YOURSELF!
(The more info you give the easier it is for others to help you out!)

Not willing to capitulate to the ignorance of the masses!

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, HanZie82 said:

Because of your question i became curious myself too.
I wnt to use the RPI4 i have connected to my TV to be able to change the RGB on my TV ledstrip.

I have been looking here: https://medium.com/coinmonks/controlling-raspberry-pi-gpio-pins-from-bash-scripts-traffic-lights-7ea0057c6a90

 

But having a very small grasp of how BASH works or what it can do i'm a bit stuck. Maybe this link can help you tho. (I got a buddy coming over to look at it so thats fine).

It does pertain to another Linux ditro but it looks like the commands should work among other Linux distro's?

Bash should work the same (I think) on any Linux distro (that has bash installed ofc).

I don’t know much about bash, but I’ve worked with it a bit, as apposed to something like python or c, both of which I’ve never used.

 

the only issue is if that guide uses lgpio like ubuntu does, or a similar program that calls the same things the same way.

I’ll take a look when I get home.

I could use some help with this!

please, pm me if you would like to contribute to my gpu bios database (includes overclocking bios, stock bios, and upgrades to gpus via modding)

Bios database

My beautiful, but not that powerful, main PC:

prior build:

Spoiler

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, HanZie82 said:

Because of your question i became curious myself too.
I wnt to use the RPI4 i have connected to my TV to be able to change the RGB on my TV ledstrip.

I have been looking here: https://medium.com/coinmonks/controlling-raspberry-pi-gpio-pins-from-bash-scripts-traffic-lights-7ea0057c6a90

 

But having a very small grasp of how BASH works or what it can do i'm a bit stuck. Maybe this link can help you tho. (I got a buddy coming over to look at it so thats fine).

It does pertain to another Linux ditro but it looks like the commands should work among other Linux distro's?

I got it to work, minimal modifications to the program

I was counting on the flashing if the system were to hang, which it kinda does stop, but it sometimes starts flashing again.

Any guess to get that to consistently detect a system hang?

I could use some help with this!

please, pm me if you would like to contribute to my gpu bios database (includes overclocking bios, stock bios, and upgrades to gpus via modding)

Bios database

My beautiful, but not that powerful, main PC:

prior build:

Spoiler

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×