• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

KaliTut

Kali Linux tutorial and Linux Tips

  • Home
  • Raspberry Pi
  • Privacy Policy
  • About us
  • Affiliate disclaimer

Raspberry pi install wiringPi

November 26, 2017 by Kalitut

Control and program Raspberry Pi GPIO with “wiringPi” (shell/bash)

raspberry pi install wiringpi

For easy control and programming of the GPIOs oftRaspberry Pi, the command line “wiringPi” has been used for a long time. Using simple commands, the GPIOs can be controlled and programmed

Note: “wiringPi” is a bit older and there are now better libraries to control GPIOs. One can even go so far as to say that it should not be used for new projects. Therefore, the presentation of the application of “wiringPi” is omitted here. The recommendation is clearly “gpiozero” and “pigpio”.

  • Control Raspberry Pi GPIO with pigpio

Configure GPIO as input or output
Here we select the GPIO 17 (pin 11) and GPIO 18 (pin 12) as examples to configure them as output and input. For this the BCM numbering of the chip is used. So the number of the GPIO and not the pin.

  • Raspberry Pi GPIO assignment

The parameter “-g” in the following commands specifies that the GPIO numbers of the BCM chip can be used. If you prefer to use the pin number, replace “-g” with “-1” (minus one).

If the GPIO 17 is to be configured as output, the following command applies.

gpio -g mode 17 out

By default, the output gets the state “low” or “0”.

If the GPIO 18 is to be configured as an input, the following command applies.

gpio -g mode 18 in

State of a GPIO output set
Basically you can only set outputs. To set the state of a GPIO output to “high”, the following command is sufficient.

gpio -g write 17 1

To set the state of a GPIO output to “low” the following command is sufficient.

gpio -g write 17 0

Determine/read GPIO status
To determine the state, ie “high” or “low”, at a GPIO, the following command is sufficient. The GPIO can be both an input and an output.

gpio -g read 18

The output “1” stands for “high” or “0” for “low”.

The following command shows the current assignment of the GPIOs and which status they have:

gpio -g readall
Post Views: 49

Filed Under: Raspberry Pi Tagged With: wiringPi

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Follow us

  • Facebook
  • Twitter
  • YouTube

Categories

  • algorithm
  • Android Ai coding
  • Android pentesting tools
  • Arduino
  • Artificial Intelligence
  • Books
  • ChatGPT Prompt
  • Darknet
  • database
  • General
  • Github Tools
  • Hacking
  • Kali Linux
  • Linux
  • Linux Commands
  • Network Administrator
  • Penetration Testing
  • Penetration Testing Tools
  • PowerShell
  • Raspberry Pi
  • resources
  • Review
  • Termux
  • Tutorials
  • Ubuntu
  • Uncategorized
  • Video Tutorials
  • vmware
  • WiFi Adapter
  • WiFi Pentesting
  • Wireless Router
  • Wireshark

Recent Posts

  • Transforming Photos with ChatGPT Prompt : A Cinematic Double Exposure in a Post-Apocalyptic World
  • Stryker Android App: Your Mobile Pentesting Powerhouse
  • Alfa awus036ach review
  • Alfa AWUS1900 for Wireless Penetration Testing
  • How to Run DeepSeek AI Locally on Kali Linux – Step-by-Step Guide

Footer

Kalitut

Kalitut.com goal is to share the knowledge for free, help you find the best tools on the web and provides tutorials

Find us on social media

  • Facebook
  • Pinterest
  • Reddit
  • Twitter
  • YouTube

Copyright © 2025

  • Home
  • About us
  • Privacy Policy
  • Affiliate disclaimer