LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 04-17-2020, 07:22 PM   #1
brian-in-ohio
LQ Newbie
 
Registered: Feb 2019
Posts: 15

Rep: Reputation: Disabled
gpio


I have a RPi 3 with slackware 14.2 installed. I would like to use the gpio in a general way. I have a pi zero with raspbian installed and use sysfs to control the pins. I'm not using i2c or pwm or anything like that, i want to read the value of a pin (high or low) in a bash script like i do on the pi zero. I want to avoid using python, and avoid using raspbian. thanks
 
Old 04-18-2020, 12:23 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,433

Rep: Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339Reputation: 2339
Hi Brian-in-ohio, & welcome to LQ.

There must be scores or hundreds of ways of doing this. The RazPi is about the most numerous and well-eperimented-with sbc out there. I'm not sure what you mean 'I don't want to use raspbian.' The Pi need an OS, clearly.

That said, Raspbian will probably have some way of doing GPIO. General Purpose Input Output (GPIO) is handy on Micro-controllers (e.g. Micrpchip's Pics) but messy on computers. The pins have to be controlled individually. They are a few pins stuck on with an awkward interface, and I very much doubt if a script will talk to them. If I needed GPIO, I would be very glad of any help in raspbian.
 
Old 04-18-2020, 06:30 PM   #3
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware
Posts: 490

Rep: Reputation: Disabled
I think you're looking for something like this:

https://www.ics.com/blog/gpio-progra...ysfs-interface
 
2 members found this post helpful.
Old 04-19-2020, 01:10 PM   #4
z80
Member
 
Registered: Jul 2019
Location: Europe
Distribution: Slackware64-current
Posts: 136

Rep: Reputation: 99
Another option is http://wiringpi.com/
 
2 members found this post helpful.
Old 04-19-2020, 08:36 PM   #5
brian-in-ohio
LQ Newbie
 
Registered: Feb 2019
Posts: 15

Original Poster
Rep: Reputation: Disabled
I think my question wasn't clear enough. Is it possible to control gpio pins using the sys calls as outlined in the link above in SLACKWARE? WiringPi installs nicely, but its a library to compile against C-code not to be used in a bash script.
 
Old 04-19-2020, 09:12 PM   #6
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware
Posts: 490

Rep: Reputation: Disabled
Check my link above. Its examples are given directly in Bash. And I have used code very similar, to turn an LED on and off, interactively, using Bash.

Addendum: in the article, the commands are presented as if for a non-root user. On my RPi, the directories and files require root privileges, so you have to log in as root (or "su -" from a non-root command line) to try them out.

Last edited by gus3; 04-19-2020 at 09:16 PM. Reason: Addendum.
 
1 members found this post helpful.
Old 04-20-2020, 01:15 AM   #7
z80
Member
 
Registered: Jul 2019
Location: Europe
Distribution: Slackware64-current
Posts: 136

Rep: Reputation: 99
WiringPI contains gpio and gpio is an executable which can be used in a shell script.
 
1 members found this post helpful.
Old 04-21-2020, 09:42 AM   #8
brian-in-ohio
LQ Newbie
 
Registered: Feb 2019
Posts: 15

Original Poster
Rep: Reputation: Disabled
Thanks z80, wiringpi works great, just the functionality I was looking for and I don't have to use raspbian or python!
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GPIO access on a Fujitsu Mini-ITX Industrial Mainboard, PCI Driver for GPIO mechatrix Linux - Embedded & Single-board computer 3 11-20-2011 03:57 PM
Using GPIO (from kernel GPIO support) in MY application DannyGilbert Linux - Kernel 2 03-16-2009 07:52 AM
Gpio rash_f Linux - Newbie 1 08-31-2006 01:14 PM
Problem with reading/writing GPIO on video card with bttv compatible chip boky Linux - Hardware 0 10-13-2005 05:08 AM
Gpio Twiddling In Embedded Linux? or How to access PCI memory space regs? jds-linux Programming 1 07-11-2004 02:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 12:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration