In article , RobH wrote:
>On 22/01/18 16:23, Andy Burns wrote:
>> Dave Liquorice wrote:
>>
>>> gpio is a utilty supplied by WiringPi which I'm fairly sure isn't
>>> included in the Raspbian distribution.
>>
>> I have a fresh Pi3 with raspian (not lite) installed via latest NOOBS,
>> and wiringPi is included.
>
>How do I find out if it is installed or not, and if not, should I
>install it.
Open a terminal and type:
gpio -v
It ought to read 2.44 (or greater) if wiringPi is installed. If it's not
installed, then:
sudo apt-get install wiringpi
will get it for you. (Assuming Raspbian or a Raspbian derived system)
The command:
gpio readall
will always give you a handy print out of the GPIO connector with the
3 different pin numbering schemes. wiringPi by default uses it's own
numbering scheme, but with the -g flag to the gpio program it uses
the native gpio pin numbers and with the -1 flag it uses the physical
pin numbers (On the original Pi the connector was marked P1, hence the -1 flag)
Pin numbering can be confusing, see this:
https://projects.drogon.net/wiringpi-pin-numbering/
The best pin out site is the Pimoroni one at
https://pinout.xyz/
A very simple way to get/test a pin with an LED is 'blink', see here:
https://projects.drogon.net/raspberry-pi/gpio-examples/blink/
I would strongly suggest that newbies do not jump into code, nor that
they try to use the sysfs interface either when starting out - it's just
too much to do, learn and get wrong - this one command is all you need:
gpio -g blink 17
to test an LED on BCM_GPIO pin 17, wiringPi pin 0, physical pin 11.
Gordon
(wiringPi author)
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|