Questions tagged [wiringpi]

WiringPi is a C language library for accessing GPIO pins.

Filter by
Sorted by
Tagged with
0 votes
0 answers
22 views

Why is digitalRead/digitalWrite not working in C++ nor in gpio terminal commands?

I'm writing in C++ using WiringPi to integrate with GPIO but it doesn't seem to work during runtime. Below I have a simple example of an output wired to an input expecting the input to read HIGH, but ...
Yato's user avatar
  • 1
0 votes
1 answer
44 views

wiringPi giving "Unable to determine board revision from /proc/cpuinfo" error after kernel 6.1 update

I was using wiringPi to to control the GPIO pins on a Raspberry Pi model 3 and 4b (these originally had Buster installed on them) successfully until today when I did a rpi-update to get kernel 6.1. ...
Baxter's user avatar
  • 1
0 votes
0 answers
44 views

How to interface 6 HC-SR04 ultrasonic sensors rasberry pi

I am a beginner to Rasberry Pi and working on a parking warning system for a go-kart. The plan is to use 6 ultrasonic sensors (3 at the front of the kart and 3 at the back) to achieve distance ...
Pasindu Danthanarayana's user avatar
0 votes
0 answers
133 views

How to use libwiringPi.so for cross compiling using CMake?

I'm trying to use CMake to cross compile a C++ code using the Wiring Pi library but I'm having trouble with making CMake to find said the correct library. Since I'm compiling from x86 to ARM in order ...
Vinícius Martins's user avatar
1 vote
1 answer
129 views

Which GPIOs can I use to shutdown Pi 4?

I am using a Pi 4 with Raspian, writing a program in Python (3.9.2) to do (amongst other things) shutdown of the Pi via a physical button. Based on this link https://linuxhint.com/set-up-shutdown-...
Clóvis Fritzen's user avatar
0 votes
2 answers
118 views

Why does the ssh connection freeze when accessing gpio pins

What is the proper method to use when creating a blinking LED example using PI zero W I connected the cathode to GPIO 37 and the anode to GND next I sshed into the pi and wrote this code import ...
netrunner's user avatar
5 votes
2 answers
20k views

wiringpi is missing from bullseye. how do i install it?

I get the following when trying to install wiring pi on a fresh bullseye image. Anyone have any way to get it installed? $ sudo apt-get install wiringpi Reading package lists... Done Building ...
user1816847's user avatar
3 votes
1 answer
791 views

Wiegand wiring guidance on Pi 4 with voltage step-down

Ok so following on from my previous post here. I have decided to start with the Wiegand wiring interface. I've drawn a diagram below to illustrate how I plan to wire everything up. Would appreciate if ...
fabbbles's user avatar
0 votes
1 answer
401 views

Using WiringPi with more than two chip selects and MCP3008

I am trying to get more than two chip selects available on the Pi. I have the devices present, but am struggling to read a MCP3008 when the CS is plugged into the additional GPIO pins. My end goal is ...
nullPainter's user avatar
0 votes
1 answer
1k views

How fast are C & Python libraries

I ran some code to monitor Pi hysteresis which involved mirroring a GPIO input to output. I was surprised as how slow the code was, so wrote a C version. Although this was slightly better it was still ...
Milliways's user avatar
  • 58.6k
0 votes
1 answer
2k views

wiringPi compile issue on RPi 4B 64bit

I am trying to compile my C++ project using CMake. My Raspberry Pi OS does include /usr/include/wiringPi.h and all the required .so files in /usr/lib/. Here is the output of gpio -v command: gpio ...
zlg's user avatar
  • 51
-1 votes
1 answer
406 views

Access Multiple I2C Ports on Raspberry Pi CM4

I am working on the Raspberry Pi Compute Module 4. I would like to implement the 2 I2C ports for the 2 different types of sensors. (must be accessed within a single application) I am using the I2C ...
shiv patil's user avatar
-1 votes
1 answer
156 views

WiringPi INPUT causes voltage below nominal 3.3v on pin with pull-up

Libs: wiringPi Hardware: Pull-up resistor (10k) to 3.3v on GPIO 24 (=THERMO_BUTTON_PIN) floating GPIO 4 (=AUDIO_BUTTON_PIN) In short, I want to implement an auto-recognition for one of two ...
jake_asks_short_questions's user avatar
-1 votes
1 answer
375 views

How to toggle RPi GPIO without system call

I want to toggle GPIO from within my C application, and be sure that it won't call kernel functions. Is wiringPi a good solution to do that, or should I do it another way?
K. Zdzioch's user avatar
2 votes
1 answer
6k views

multiple UARTs on the 40-pin

i am trying to connect two devices via UART to a raspberry 4. one being a stepper driver (i dont need much throughput), one being an image sensor (the higher the baud rate is i can get, the better). ...
rmalchow's user avatar
  • 171
0 votes
1 answer
2k views

fatal error: wiringPi.h: No such file or directory

Learning cmake for use with CLion. I have a raspberry pi project and I'm trying to bring in wiringPi library on my Ubuntu box. Here's my build results. ====================[ Build | rookery_exe | ...
Thom's user avatar
  • 117
0 votes
1 answer
209 views

Raspberry Pi: How to check I2C Bus Busy Status in Multi-Master mode

I am working on the Wiring Pi I2C Example codes. In my case, I am using the 2 masters over the same I2C Bus. I am getting some errors like 0x00 + Missing ACK/NAK Even the Clock pulse is not in 50% ...
shiv patil's user avatar
1 vote
2 answers
151 views

How to check if wiringPiSetup() was run

I am working on a C++ project using several objects that use wiringPi. When I initialize the objects each runs wiringPiSetup() in their constructor. If I test the objects individually all o them work. ...
FR_MPI's user avatar
  • 71
3 votes
1 answer
62 views

magnetic field generated by the engine alternator affects gpio value

I am working on a dashboard for a motorcycle. I created a Qt application on my raspberry pi 4 on a raspberry pi os lite. I have configured one of my GPIO as interrupt using the wiringPi library. ...
mina's user avatar
  • 357
0 votes
1 answer
502 views

WiringPi SPI without Chip Select/Enable?

I am wondering how the WiringPi SPI works without using the chip select/enable spi.cs_change = true; in the following code. int wiringPiSPIDataRW (int channel, unsigned char *data, int len) { struct ...
Skoog's user avatar
  • 1
0 votes
1 answer
769 views

How to read SPI memory with raspberry pi? (using wiringpi)

This is the pinout I have for the flash memory W25Q128FV which I'm trying to interact with I'm trying to control it with a raspberry pi 3 B+. Here's how I wired everything: CS - GND D0 - SPIMISO WP - ...
PPP's user avatar
  • 33
0 votes
0 answers
234 views

How to use 4 CS for SPI in C++

I'm currently trying to implement 4 CS in RaspPi. I'm still a newby in this field and used the library wiringPi. For CS0 and CS1 this works totally fine. However now I have 2 more CS on the GPIO Pin ...
Archiac's user avatar
-1 votes
1 answer
1k views

Raspberry Pi Software Driven servo control with PWM using C and Wiring Pi LIbrary

I'm trying to get my raspi zero to move an SG90 PWM driven servo. I have achieved this with python already using the gpiozero library, so I know my hardware works but I am trying to do it with C using ...
Dyskord's user avatar
  • 119
1 vote
4 answers
4k views

GPIO pins not changing state

I have Raspberry pi 4B, and I want to interact with the GPIO pins. I connected simple LED wiring to physical pin's 37(GPIO25) and 39(GND). After exported pin, and set up mode to "out", I ...
revBull's user avatar
  • 21
2 votes
2 answers
3k views

GPIO not working on Raspberry PI 4 4GB

I have a RPi 4 running Raspbian with the Ubuntu Mate desktop environment, whenever I try to use the Wiring Pi library through a C script, to doesn't work at all. On using the gpio readall command I ...
pyramiskyma's user avatar
1 vote
0 answers
62 views

Rotary encoder working on Pi 3 but not on Pi 4

I'm trying to read an encoder switch using wiringPi (latest, 2.52). Whenever there is an edge on either of the encoding pins a or b, I store a snapshot of the state of both pins on two bits: int val = ...
schmop's user avatar
  • 179
1 vote
2 answers
5k views

wiringPi.h not found by gcc. Works in Raspian, not Ubuntu Mate

This is my first time posting on stack exchange so I apologize if this is too much or not enough info on the problem. A few months ago I installed Ubuntu Mate 18.04 on a Raspberry Pi 3B+ and tried to ...
Silas D.'s user avatar
0 votes
1 answer
1k views

how to use MCP23S17 pin expander via SPI

I'm working on a custom sensor that is wired to a couple of MCP23S17 gpio expanders, which are in term connected to a Raspberry Pi 4 via the SPI pins i.e. SPI_MOSI, SPI_MISO, SPI_SCLK and CE0 pin. I'm ...
WARdd's user avatar
  • 49
3 votes
1 answer
5k views

Enabling of I2C-0 via "dtparam=i2c_vc=on" on Pi 3B+ causes "I2C-10" & "I2C-11" to appear and disables GPIO 10 GPIO 11

For reference: I am using the latest release Pi OS Lite, Aug 2020 version. I am developing an application using Pi4J. I am referring to pins via this Pinout: Pin Numbering - Raspberry Pi 3B+ I am ...
MountainPi's user avatar
-2 votes
3 answers
219 views

says i don't have wiringpi module when runing code at startup

I have a code set up to run at boot, and it works fine when I start it via terminal, but it doesn't run at boot. I opened the terminal, and this is what I saw: Running at boot Traceback (most recent ...
user avatar
1 vote
0 answers
278 views

I2C, SPI and Python Libraries with Raspberry Pi 4b

I've been working with RPi.GPIO so far but I have had issues with PWM and edge detection, which are well known issues with RPi.GPIO, anyway, after some research I'm considering using a different ...
Pokebab's user avatar
  • 86
0 votes
0 answers
71 views

Can't get to toggle leds with WiringPi library in C

So I got my python code to run that basically just toggles the LED, but now I tried enabling the GPIO via WiringPi library in C but it doesn't work. Considering python code runs, there isn't really ...
MKD's user avatar
  • 3
0 votes
3 answers
450 views

libpgiod vs wiringPI code/configuration

I have an RPI, setup with wiringPi and some code I wrote to read a quadrature encoder. It works just fine, I can read the pins, using a wiringPiISR mechanism (the ISRs get executed on the rising as ...
Ron's user avatar
  • 11
3 votes
2 answers
368 views

Output resistors and GPIO

I am planning to control a IC (CD74HCT299E). I have currently GPIO-pins directly hooked up to the IC. My Question is, does the Raspberry pi have resistors before the GPIO-pin, or do I have to or ...
C0D3 M4513R's user avatar
1 vote
1 answer
342 views

Running pump & servo - Relay needed?

simulate this circuit – Schematic created using CircuitLab So I am working on a project that will require both a servo motor plus a small water pump. Both run on 3.7 -6v and I am going to use ...
Smellegg's user avatar
2 votes
1 answer
1k views

How to write 16 bit data to device address using the i2c wiringpi lib

I am trying to write 16 bit data to i2c device . As there are no registers specified to write to the slave device, I am not able to use the built-in wiringPiI2CWriteReg16 Api. Can some one guide me ...
shraddha koli's user avatar
0 votes
0 answers
5k views

gcc and g++ compilers don't find wiringPiSetup() and wiringPiI2CSetup() functions

Update/solution: The sample program(s) Gordon refers to are at github/wiringPi - specifically for me lcd-adafruit.c. On my Rpi, the correct libraries are in /usr/lib and are libwiringPi.so and ...
Joe Wharton's user avatar
1 vote
0 answers
27 views

How do I hold SPI high value?

I'm using wiringPi spi library to communicate two raspberries. As the spi clks aren't synchronised, I don't read the high values, since they are only a pulse. Is there a way to hold the high value ...
Frank's user avatar
  • 11
1 vote
0 answers
136 views

Controlling PWM by wiringpi through python programming [closed]

Can anyone give me the program for controlling PWM by wiringpi through python programming? I have already searched on the net but could only find program through C programming.
Abhilash Wakodikar's user avatar
0 votes
0 answers
176 views

Initializer element is not constant serialOpen WiringPi

I'm getting an error when trying to run some code on my raspberry pi. Here is the source code: /* SimpleReceive This sketch displays text strings received using VirtualWire Connect the Receiver data ...
ajnauleau's user avatar
  • 109
0 votes
0 answers
351 views

Can't read data from PN532 NFC reader over SPI

I'm using Pi4J library to read data from a NFC reader based on PN532, connected to my Pi via SPI. However, I don't seem to receive any data from if when I put a NFC card to my reader. I'm using SPI0 ...
mag_zbc's user avatar
  • 121
1 vote
1 answer
179 views

Crontab with WiringPi

I want to change pin state at certain time with Crontab. I tried to use this command: 7 0 * * * /usr/bin/gpio -g write 0 0 but it returns me this error: bash: 7: command not found I also tried: 7 0 * ...
ksiadz510's user avatar
1 vote
0 answers
83 views

Changing speed of a stepper motor break the rotation smoothness?

I'm using node-stepper-wiringpi with the L298N driver (12V) to control a stepper motor. If i put a speed of 30 the rotation is smooth but if i put more than 30 the stepper struggle to make the ...
Owow's user avatar
  • 123
3 votes
2 answers
2k views

GPIO pullups not working?

Sorry for the very basic question. I am trying to set a built-in pullup on GPIO pins and it doesn't seem to be working. Hardware is Pi 3B and 4B (I tried on both), OS is Raspbian 10 (buster). The ...
One Guy Hacking's user avatar
2 votes
1 answer
4k views

WiringPi and ADS1115 C/C++ sample programs

I am trying to create c++/c program to AnalogRead using and ADS1115. I have seen that wiringPi has support for ADS1115 but i could not find any sample program to start with. Can anybody link guide me ...
Jack's user avatar
  • 686
4 votes
4 answers
4k views

Setting Pull Up/Pull Down mode doesn't work (mostly)

I can't seem to set the pull-up resistor mode on the PI4 with most methods I try. I have tried: C# (the new System.Device.Gpio interface), WiringPi (using a C# abstraction), and wiringPi command line ...
PMF's user avatar
  • 864
0 votes
0 answers
209 views

using Pi Zero W GPIO relay control

I am trying to control my relay with Raspberry GPIO. Using the terminal to write to gpio5 (Physical 18, BCM 24) works: gpio mode 5 out gpio write 5 1 Trying to do the same in my c++ code doesn't ...
Waffel's user avatar
  • 1
1 vote
2 answers
981 views

Wiring Pi Issue - #!/bin/bash vs #!/bin/sh

I am working on a project and have an application shell script. For function part, I need the GPIO access, and for that, I am using the standard wiringpi package. The issue I am getting is with the #...
Kunal Sonone's user avatar
0 votes
1 answer
466 views

How rpi3 as slave use i2c with wiringPi

I tried to let my rpi3 with wiringPi as slave to receive data from master and data +1 send to master . mater send 1 to slave (rpi3) My rpi3 SDA is GPIO 18 ,SLC is GPIO 19 the code on my rpi3 : #...
林柏逸's user avatar
-1 votes
1 answer
290 views

How to use at the same time 2 hardware pwm in wiringpi

I need help to configure 2 hardware PWM channels. I am developing device, and sometimes I will need active 2 PWM channels with different frequencies (frequencies is low: 410 and 580 Hz).I'm writing ...
Vladislav Emets's user avatar

1
2 3 4 5