Questions tagged [wiringpi]

WiringPi is a C language library for accessing GPIO pins.

Filter by
Sorted by
Tagged with
0 votes
1 answer
493 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
312 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 vote
1 answer
714 views

How can I require root privileges for invoking 'gpio' from WiringPi?

I removed my user from the gpio group, logged out and back in. I can still run e.g. gpio write 25 1. I see from this answer how the memory mapping and permissions changed between Jessie and Stretch, ...
Ed Peguillan III's user avatar
1 vote
0 answers
274 views

Interrupt issue - Wiringpi and pigpio show different values for pin

I am having an issue with raspberryio/wiringpi interrupts. A lot of extra interrupts are generated. My configuration is as follows: Physical pin 16: Set as input Pulldown resistor Interrupt ...
Fuzzytrooper's user avatar
2 votes
2 answers
4k views

What is the correct way to use /dev/gpiomem with mmap to get access to Raspberry PI3 peripherals

I'm implementing a pascal library to deal with RPI3 peripherals. My goal is to control GPIO pins' functions, pins' logical levels, pins' pull resistors, I2C and PWM, at least. To achieve this I'm ...
Carlos B. Feitoza Filho's user avatar
0 votes
3 answers
4k views

Input on GPIO at very Fast Speed

I am getting a signal at 1 GPIO which i need to read at an interval of exactly 10^ (-6) seconds. I am using wiringpi.h in C and the issue is that digitalRead() also takes some time thus i am not able ...
user3622654's user avatar
1 vote
1 answer
559 views

pwmWrite() does not change dutycycle immediately

I'm using wiringPi for PWM on BCM18. I tried to use this to generate a STROBE-equivalent signal to turn ON the LED for the Camera Capture. My intention is to synchronize the LED-ON to shutter opening (...
Srinivasa HC's user avatar
3 votes
1 answer
3k views

Cross compiling for RPi - error while loading shared libraries

I'm trying to compile a simple program on my Ubuntu using the ARM cross compile toolchain (arm-linux-gnueabihf-gcc) and run it on my Raspberry Pi. The program is using the wiringPi shared library (...
A6SE's user avatar
  • 133
0 votes
2 answers
508 views

Connecting multiple DHT11 sensors using WiringPi and C

For my internship I need to get measurements of multiple dht11 sensors and send them to a database using a REST API. I decided to go with WiringPi and C. I followed this tutorial: http://www....
FriedGov's user avatar
1 vote
1 answer
238 views

GPIO not fast enough for RF transmitter?

I'm trying to control a 315MHz RF socket using the RCSwitch library. I tested with an Arduino and it worked 100% of the time but when porting over to a pi zero I can only get it to correctly turn on / ...
1234123121's user avatar
0 votes
1 answer
780 views

Python RPIO.ChangeDutyCycle() Equivalent in WiringPi (C)

I'm currently developing an application with the WiringPi library. I have implemented a prototype in Python, and I'm currently trying to reproduce the same behaviour in C++. However, I ran into some ...
mathlizee's user avatar
  • 103
1 vote
0 answers
1k views

Access Timer Interrupts in Raspian

I want to write a C program that runs some code at a fixed interval (somewhere between 200us and 1ms, TBD). Is it possible to use the hardware timer interrupts to execute code without resorting to ...
newothegreat's user avatar
0 votes
2 answers
5k views

Why is WiringiPi unable to find hardware revision?

I installed Ubuntu 18.04 on a Raspberry Pi 3 B+ and WiringPi following the instructions presented here. The problem is that when calling the GPIO utility, I get the following error: It seems that the ...
Cristian M's user avatar
1 vote
0 answers
152 views

Adafruit Ultimate GPS with Rpi 3 "Permission Denied"

I am trying to connect an Adafruit Ultimate GPS to my Raspberry Pi 3 and read data from it using the WiringPi Serial library. I have set the serial connection up and removed the serial console through ...
mike's user avatar
  • 13
-1 votes
1 answer
5k views

Serial Port & C Code

I have a sensor connected to an ODROID UART (Basically an RPi just a different name for the UART port) and using the WiringPi Serial library. I am able to echo/cat to the sensor via two terminal ...
mrlooneytoon's user avatar
0 votes
1 answer
583 views

GCC and makefile on Raspberry Pi running NOOBS deletes my c file

I am having an issue with my pi where I run gcc or make from the terminal and my main c file included in the compilation is deleted. I am using the wiringPi library to communicate with some sensors ...
mike's user avatar
  • 13
0 votes
1 answer
261 views

Can't trigger GPIO control via executable run through php's exec function

/var/www/html/index.php <?php exec("./on"); shell_exec("/var/www/html/on"); on.cpp #include <string> #include <getopt.h> #include <cstdlib> #include <sstream> #include &...
I like to code's user avatar
2 votes
1 answer
1k views

How to access to I2C software with wiringpi library-

I want to use I2C software instead hardware I2C. Because a buggy parto of the I2C related with clock stretching. I can enable in boot.txt adding this: dtoverlay=i2c-gpio,bus=3 It would create a /...
Mquinteiro's user avatar
0 votes
1 answer
146 views

Wiring Pi - BCM 20 works with a button, but not BCM 21 :-(

I have two switches (buttons). Red is connected to physical pin 38 (BCM 20) and green to physical pin 40 (BCM 21). I call wiringPiSetupGPIO() it returns 0. When I use pullUpDnControl(redSwitch, ...
Michael Rogers's user avatar
1 vote
0 answers
351 views

WiringPi install using npm fails

I'm having a hard time installing the wiring-pi node package. It fails on the step "Making wiring-pi ...", spaming the terminal with build errors. If I clone and install wiring-pi manually as ...
Boern's user avatar
  • 192
1 vote
0 answers
51 views

Raspberry-pi read data from thermometr

I am newbie at raspberry. I have raspberry Raspberry Pi Details: Type: Pi 3, Revision: 02, Memory: 1024MB, Maker: Sony * Device tree is enabled. *--> Raspberry Pi 3 Model B Rev 1.2 ...
unknown's user avatar
  • 21
0 votes
1 answer
157 views

RaspberryPi getting error after reading some serial Input, using rs232 and C Language

my raspberry keep getting error after reading some serial input, like this: i'm using Library wiringPi with this sample code: #include <stdio.h> #include <string.h> #include <errno.h&...
Faviansyah Arianda's user avatar
1 vote
0 answers
360 views

DRV2605 + TCA9548A I2C Multiplexer gets sporadic "Remote I/O Error"

The setup is a raspberryPi driving two AdaFruit DRV2605s through an AdaFruit TCA i2c multiplexer and it all works correctly the bulk of the time. I adapted the sample Arduino code and by and large we'...
Jmc's user avatar
  • 111
1 vote
2 answers
385 views

How to find out whether GPIO is HIGH (without RPi.GPIO module)

I was wondering if there is a way to find out that a GPIO is under voltage, say - the GPIO is set to HIGH. I need to be able to check this in a linux terminal, using a command or a script that simply ...
mtbno's user avatar
  • 215
2 votes
1 answer
4k views

Reading Multiple bytes in Raspberry Pi over I2C using Wiring Pi library [closed]

0 down vote favorite I am trying to build one sensor interface using Raspberry Pi over I2C. I have installed WiringPi. I am seeing limitations of wiringPi library, that supports only 1 or 2 bytes I2C ...
shivakumar's user avatar
0 votes
1 answer
876 views

Reading multiple channels from a pcf8591 ADC

I am writing a little "oscilloscope" program in c++ using /dev/fbx. I am reading in analog values via a pcf8591 connected to the I2C bus. Every thing works well if I only read 1 channel of analog data....
Art Sayler's user avatar
0 votes
1 answer
445 views

WiringPi shiftOut with HCF4094 shift register

I have problems getting the raspi/wiringPi to work with a HCF4094 shift register. I am using the following code part: #include <wiringPi.h> #include <wiringShift.h> #include <iostream&...
david's user avatar
  • 103
1 vote
1 answer
651 views

Unosquare.RaspberryIO: unregister from InterruptCallback

I'm developing an application on C# using Unosquare.RaspberryIO. My question related to interrupts and callbacks. According to the documentation, it's possible to register callbacks. For example: pin....
Andriy's user avatar
  • 11
-1 votes
2 answers
5k views

Compiling a C program latest version of wiringPi

System: RPi 3 B OS: Ubuntu 16.04 Mate desktop. Uninstalled pre-installed v2.32 wiringPi package. Downloaded latest version from the wiringPi site. Ran build. The build worked; gpio ...
Farad'n's user avatar
  • 129
0 votes
0 answers
1k views

Toggling LEDs on/off using the wiringPi library and threads

I'm following the instructions at http://wiringpi.com/reference/priority-interrupts-and-threads/ using the PI_THREAD and piThreadCreate(myThread) methods and cannot get the LED(s) to blink. Here's the ...
Farad'n's user avatar
  • 129
1 vote
2 answers
3k views

WiringPi Library and PCA9685 throwing errows

I am using this example code PCA9685 in C and whenever I run the code I get this as my output: PCA9685 servo example Connect a servo to any pin. It will rotate to random angles pwmWrite: You have ...
lauro199471's user avatar
-3 votes
2 answers
133 views

Can somebody please tell me how to wire this?

I litterally cannot find it anywhere on how to wire this https://www.adafruit.com/product/2934 The only thing any of the pigrrl schematics show is connecting wires from b1,2,3,4 to pins on another ...
user25832's user avatar
  • 121
0 votes
0 answers
273 views

How to read data from PIR sensor which is controlled by relay i2c?

There are my first steps with RPi and i2c. I use expander pcf8574 and I would like to drive a relay to control LED and PIR sensor. When the state on sensor is HIGH, LED should be turn on. I wrote a ...
adrian0808's user avatar
0 votes
0 answers
864 views

How could I write a C function using the wiringPi SPI library to read the X and Y measurements from this 2-axis inclinometer?

How would one use the wiringPi SPI library (http://wiringpi.com/reference/spi-library/) to get the x and y readings from this SCA100T inclinometer? I understand that the function wiringPiSPIDataRW() ...
user124757's user avatar
1 vote
1 answer
2k views

What does Pin Base mean in WiringPI Library?

I cant seem to find a clear answer what "pinBase" does. Does anyone have an idea what it does? Thanks! Code node = wiringPiNewNode (pinBase, 8) ; Function struct wiringPiNodeStruct *...
lauro199471's user avatar
1 vote
2 answers
1k views

Rpi interfacing MCP4725 12-bit DAC pproblem

I am using raspberry pi 3. I am trying to run the AC induction motor for that I want an analog pin. In raspberry pi model doesn't have an analog pin. All pins are digital IO pins. So I have tried MCP ...
uvan's user avatar
  • 13
3 votes
1 answer
331 views

Export GPIO pins from extender

I have PCF8574 GPIO extender connected to RPi. I use GPIO Sysfs. It is possible to write/read to/from extender pins, using command like this: gpio -x pcf8574:352:32 read 358 But i can not export ...
mackowiakp's user avatar
1 vote
0 answers
1k views

How to Read LDR Input with Raspberry Pi's GPIO Pins in C? [closed]

Using an LDR and the below circuit diagram, I am trying to read the amount of light that the LDR is receiving. My primary goal is to detect a change when an object passes over the LDR to trigger an ...
Joshua Marotta's user avatar
1 vote
1 answer
725 views

How can I use Garage Door Safety Sensors with Raspberry Pi?

I am trying to use garage door safety sensors as a way of counting cars. From my understanding, if there is no object (car) between the sensors, then they output a 3.3V signal every 6 milliseconds. If ...
Heisenber44's user avatar
1 vote
3 answers
14k views

wiringPi.h: No such file or directory #include < wiringPi.h>

When I try to compile I get this error: fatal error: wiringPi.h: No such file or directory #include < wiringPi.h> ^ The code is: My includes are: #include < ...
dka13's user avatar
  • 163
1 vote
1 answer
1k views

Can't access GPIO pins directly from C++ with wiringPi

I'm trying to access the GPIO pins of a Raspberry Pi 3 model B directly from c++. This code works fine with wiringPiSetup() and wiringPiSetupGpio() but I want to access the GPIO registers directly ...
Turtle Turtleston's user avatar
-1 votes
2 answers
2k views

wiringPiISR() edge detection

Does wiringPiISR() set up Synchronous or Asynchronous edge detection and are inputs e.g. pinMode( , INPUT) set up with hysteresis (Schmitt trigger)? All of these seem options in the Pi GPIO ...
Steve R's user avatar
  • 19
1 vote
1 answer
2k views

Wiring Pi - Root not required?

I developed some code using wiringpi on a 4.4.21 machine (Jessie) - it worked fine and as expected, required root privilege to run (i.e. requires sudo) - it uses wiringPiSetup(). I moved the code ...
Steve R's user avatar
  • 19
0 votes
0 answers
579 views

Linx GPS UART communication using wiringPi

I have a Linx RXM-GPS-R4-x GPS module that uses the UART pins on the Raspberry Pi 3 model B's GPIO pinout. I'm also using the wiringPi's serial library. However, I'm having difficulty with ...
Brandon Williams's user avatar
1 vote
1 answer
944 views

Parallel/simultaneous read

Is there a way to read more than 1 port pin simultaneously (like a parallel port read) using wiringpi? I can see wiringpi functions to do a single pin read (digitalRead()) - but in my application I ...
Steve R's user avatar
  • 19
1 vote
2 answers
506 views

Is pinMode necessary in wiringPi programming?

Why we need to mention the pin is for input or output via pinMode. Can I simply use digitalRead or digitalWrite without setup the pinMode in before? In other words, if I set a pin as the output, can I ...
JustWe's user avatar
  • 145
0 votes
1 answer
491 views

Unable to get input from RPi3 GPIO serial, crashes when using RX pin

I have a sensor which spits out information via serial and I am trying to receive that input on my Raspberry Pi 3 via the serial RX (BCM pin 15). I'm using the wiringPi library in a C++ program to ...
sealj553's user avatar
1 vote
0 answers
200 views

WiringPi can only turn on 8 LEDs

On my RPi 3 I have a PHP website to control 10 LEDs. Each is wired to a separate GPIO pin and 220 ohm resistor. Here is the code: <html> <head> <title>LED Control</title>...
Yubin Lee's user avatar
  • 121
0 votes
0 answers
285 views

wiringPiSetup() hangs system

My Pi user is a member of the group "gpio". I have a C++ programm calling "wiringPiSetup()". Whenever I forget to use sudo, my Pi is not reachable anymore and I have to do a power cycle. I know that I ...
Christian's user avatar
  • 259
1 vote
0 answers
80 views

How to determine Gpio write mode [closed]

Hello I'm creating a cgi script to turn on one led (Red) while blue is off and vice versa it's more like a quiz buzzer Here's a code #!/bin/bash ch=gpio read 16 if test $ch -eq 1 then ...
sten's user avatar
  • 11