Questions tagged [wiringpi]

WiringPi is a C language library for accessing GPIO pins.

Filter by
Sorted by
Tagged with
1
vote
1answer
906 views

UART communication - AVR C to Raspberry Pi 2 Python [closed]

I am still a Raspberry Pi newbie. I am using an Atmega32 to transmit data to a Raspberry Pi 2 via UART. The Atmega transmission code is in C and the RPi receiving code is in Python 2.7. Below is the ...
1
vote
2answers
340 views

main() and interrupt function runs at the same time?

Im using Raspberry Pi 3 model B. Using wiringPi library. For ISR I use , wiringPiISR (). When the interrupt occurs , the interrupt function get executed along with the main(). But I want to pause ...
1
vote
0answers
240 views

How to configure MAX11647

I am using this i2c 10 bit ADC for temperature sensing and battery level sensing with the Raspberry Pi. What is the correct way to configure this device? I tried writing the values 0x82 to the setup ...
1
vote
0answers
300 views

Using three SPI channels with wiring pi?

I was wondering if there is a way to use three different channels for SPI through the wiring pi library. I mean I know that a chip/slave/channel select pin can be any pin capable of sending a high or ...
1
vote
0answers
320 views

Combination of ServoBlaster and wiringPi won't work

I would like to control a servo and a dc motor. I want to control the dc motor's speed by using pwm with a frequency >= 1000 Hz. The servo on the other hand expects a pwm frequency of only 50 Hz. So ...
1
vote
0answers
41 views

WiringPi traffic light in C [duplicate]

I am working on a project for my C programming class and need to use wiringPi on my raspberryPi. I need to create a traffic light (like a real one- red to green to yellow to red, etc.) and a ...
1
vote
2answers
3k views

wiringPi cleanup command

I have some experience with the python GPIO library and am working on porting some of my code to C for better performance. Normally, at the end of programs, or when I break out of them with Ctrl-C, I ...
1
vote
1answer
715 views

allow other user to run wiringPiSetupSys()

I hava e program called outlet in which I communicate out on wiring pin 2 corresponding to BCM-PIN 27 on my Pi: #include "NewRemoteTransmitter.h" #include <stdlib.h> #include <stdio.h> ...
1
vote
1answer
550 views

WiringPi - GPIO Output Vs PWM

So in the GPIO utility from WiringPi there is a command to change the mode of the GPIO pins. There is input mode, output mode and PWM mode. What is the difference between output mode and PWM mode? Is ...
1
vote
0answers
289 views

Increase Performance of 4x4 LED Matrix (Multiplexing with pi4j)

I have coded a Display-Class to drive a X by Y LED-Multiplexing-Matrix with pi4j. However, I when driving a 4-by-4-Matrix I cannot get the framerate beyond roughly 30 fps, which still produces a ...
0
votes
2answers
390 views

When to set internal pin resistance at software layer

I'm trying to wire my Raspbery Pi 1 Model A (hereafter RPi) to a simple 6VDC buzzer and here is my best attempt: So the 3.3V power pin from the RPi is connected to the breadboard's top-most rail via ...
0
votes
3answers
446 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 ...
0
votes
1answer
229 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 ...
0
votes
1answer
190 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 ...
0
votes
1answer
961 views

How to address gpio pins

I'm kind of new to raspberry pi, and I saw a tutorial about making a LED blink. The LED was connected to pin 17, but the tutorial said pin 11. I connected the LED to pin 17, and in the terminal I ...
0
votes
2answers
2k views

2004-LCD with PCF8574-I2C and wiringPi (Python)

I try to interface my 2004-LCD display with wiringPi (in Python 3). The display is connected to a PCF8574-chip, so I need to use I2C. This is my test code: import wiringpi2 as wiringpi wiringpi....
0
votes
2answers
13k views

how to read output of gpio readall

I never used wiringpi library before. I'm trying to understand how to read the output of gpio readall. What are the BCM and wPi columns? What does ALT0 mode mean? I searched online for output ...
0
votes
2answers
5k views

wiringPiSetup: Must be root (Did you forget sudo ?)

I have a problem when I click run it shows this error wiringPiSetup: Must be root (Did you forget sudo ?) I also try to write this on terminal sudo qtcreator to open the qtcreator as sudo but ...
0
votes
1answer
401 views

Is there any way to read/get pin mode using python (and wiringPi) [closed]

I have a database with table pins with atributes pinNo, pinMode and pinState. I'm trying to read these raspberry pi's atributes using wiringPi in python script, and to write that data into the table ...
0
votes
1answer
40 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 : #...
0
votes
2answers
115 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....
0
votes
1answer
67 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 &...
0
votes
1answer
78 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, ...
0
votes
1answer
213 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&...
0
votes
2answers
1k 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 ...
0
votes
2answers
518 views

DAC MCP4725 not working with raspberry

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 ...
0
votes
1answer
94 views

help reconstructing blinking LED circuit that required GPIO #17 pin low rather than high

I am working through a series of lessons on using the Raspberry Pi 3 Model B with the Osoyoo Raspberry Pi Starter Kit. The first lesson is to build a simple circuit in which GPIO #17 is used to power ...
0
votes
1answer
595 views

Is wiringPiSetup BCM or BOARD?

I am using WiringPi to simulate PWM output to my GPIO pins. My problem is that I converted from the regular Rpi.GPIO library to WiringPi. I used BCM as GPIO mode but now WiringPi uses BOARD. How can I ...
0
votes
1answer
120 views

Adafruit 16 Servo Hat

I am new to Raspberry Pi and Linux so sorry for the basic questions. I am utilizing the Adafruit 16 Servo hat for the Rasperry Pi. The Hat utilizes I2C. I am programming in C and have had difficulties ...
0
votes
1answer
669 views

WiringPi digitalRead don't works everytime

I'm using digitalRead of wiringPi to detect packet received in CAN chip, so i'm send data and wait for falling edge of the can interrupt pin as you can see here: gettimeofday(&t1, NULL); ...
0
votes
1answer
220 views

Daisy chained 74HC595 driving dual 7 segment LED intermittent incorrect output

I have two 74HC595 driving two 7 segment LED displays and I wrote a simple C program to either display a specified number (00-99) from argv or count from 00 to 99. When specifying a value from the ...
0
votes
1answer
495 views

َUArt in Raspberry Pi

I use this code .It send data but cant get it.I short circuit Tx & Rx in Raspberry. I use this tutorial: http://www.raspberry-projects.com/pi/programming-in-c/uart-serial-port/using-the-uart ...
0
votes
1answer
6k views

Send and Receive data in uart with raspberry pi in c and wiringPi [duplicate]

I do all things like below but it dont work well this is my code : #include <stdio.h> #include <string.h> #include <errno.h> #include <wiringPi.h> #...
0
votes
1answer
188 views

Is there a way to leave the SDI (MOSI) signal high during an SPI transaction?

I'm looking for a way to leave the MOSI signal high on a Raspberry Pi during an SPI transaction. I have an Si8902 ADC which reads voltage from a PCB, and its pins are connected to the appropriate pins ...
0
votes
1answer
51 views

Wiring Java not always works

I just started my developments with wiring pi but i'm facing some problems with method not always being executed on Raspberry. // LED1 SoftPwm.softPwmCreate(0, 0, 100); // RED SoftPwm....
0
votes
1answer
533 views

Pin GPIO5 set to output by default with constant 2.4V output during and after boot

I have been experimenting with rpi in the last few days and made a simple user interface circuit, it contains a button and few LED's attached on top of rpi as you can see below. It works fine but the ...
0
votes
1answer
881 views

HC-SR04 ultrasonic sensor reading becomes highly unusable when PWM is active

Good day I am trying to sample distance using a sonar/ultrasonic sensor for altitude measurement. When the PWM is not active, the sensor gives accurate measurements in centimeters, however with the ...
0
votes
1answer
568 views

Sequential Control - time and signal based in C

i want to program in C a simple sequential control with the raspberry. The current task is: If a button is pressed, something (e.g. a LED) shall be switched on for 5 seconds and then go off itself. ...
0
votes
1answer
2k views

wiringPiSetupSys - input pin state does not change

I try to port my GPIO project from quick2wire to WiringPi. My aim is to read the state of a photocell connected to pin 24 of my raspberry pi (model B, revision 2). My code (python 3) looks like this: ...
0
votes
1answer
589 views

How can I get an SPI ADC (MCP3002) on RPi2

I would be happy if you give me a advice or show me the sample code. One year before, I wrote a luminosity sensor application on my RPi model B in Ruby. Thanks to the this library I could make app ...
0
votes
0answers
34 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 ...
0
votes
1answer
57 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 ...
0
votes
1answer
115 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 ...
0
votes
1answer
55 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&...
0
votes
1answer
342 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....
0
votes
2answers
1k 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 ...
0
votes
0answers
559 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 ...
0
votes
0answers
188 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 ...
0
votes
0answers
503 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() ...
0
votes
2answers
931 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 ...