Questions tagged [wiringpi]

WiringPi is a C language library for accessing GPIO pins.

Filter by
Sorted by
Tagged with
2
votes
1answer
4k views

WiringPi: using interrupts with Python

I want my RaspberryPi to perform some actions when the light in a room is switched on or off. To do so, I connected a photocell to the GPIO pins. Previously, I used some python 3 program that queried ...
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: ...
3
votes
0answers
3k views

GPIO23 (BCM) is busy when using /sys/class/gpio but I am able to use wiringPi pin 4 (GPIO23)

I'm having a bit of trouble accessing GPIO23 using /sys/class/gpio/. To clarify a few terms (according to the table on this page): Header pin 16 is BCM GPIO 23, which is wiringPi pin 4. Header pin 11 ...
0
votes
1answer
583 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 ...
2
votes
2answers
7k views

How to run 2 servos with wiringpi2 on Raspberry pi 2

Hello I want to use 2 servo with different gpio pins. But Raspberry has one hardware pwm (GPIO 18). first of all I tried another pin to run servo and my code: wiringpi.pinMode(18,2) wiringpi....
4
votes
2answers
1k views

Cannot open 12V Solenoid Valve

I am a beginner in DIY electronics, and I am attempting to control a 12V Solenoid valve from a Pi B2 connected to a 12V Battery and WiringPi Pin 1. I am using a 1kOhm Resistor between the gpio pin ...
0
votes
1answer
155 views

Infinity cascade IO expand module [closed]

Has anybody used Infinity cascade IO expand module for Raspberry PI? Like the one described here http://www.bananapi.com/index.php/purchase/2-uncategorised/36-banana-pi-io-extend-board, but only red. ...
3
votes
3answers
5k views

Can we determine the mode of a GPIO pin?

As I understand it, the mode of a GPIO pin can be INPUT or OUTPUT (and I think there may be other modes such as PWM and I2C). I believe that the mode of a pin is a global and that if two applications ...
2
votes
1answer
1k views

How do I access the Wii Nunchuck using WiringPi

The Wii nunchuck is an I2C accessible device and can be wired to the I2C pins of a Pi. How do I read the data from a Wii nunchuck in C using the WiringPi library?
2
votes
1answer
2k views

WiringPi Interrupt Problem

I'm trying to get interrupts working on the Raspberry Pi using the wiringPi library. When using INT_EDGE_RISING the code below results in very few interrupts when operating the button. This is ...
5
votes
1answer
3k views

Reading HC-SR04 echo with wiringPiISR()

The following code works with the busy wait, but if I replace the while loop with a call to wiringPiISR() it always returns 0 for the distance. I also tried calling wiringPiISR() before raising the ...
5
votes
2answers
2k views

Raspberry Pi to Arduino (Leonardo) avoiding latency

I'm using a Python script via (TkInter) on the Raspberry Pi to capture mouse movement and events. My goal is to send this data, in real time, to another connected Arduino device(Leonardo). My first ...
1
vote
1answer
44 views

Logic State non-responsive

I need the raspberry Pi to respond to some buttons. I'm writing this in Pure C, using the wiringPi library. As such, I thought it prudent to use the gpio utlitily to make sure my pins were sane ...
2
votes
1answer
309 views

Small voltage on GPIO output

I tried using the wiringPi GPIO library just to test some basic IO, but when I tried to output HIGH on a pin (GPIO 25) the voltage only went from 0V to 0.03V, is this normal? If this is normal that'...
2
votes
2answers
3k views

Controlling a servo with hardware PWM using wiringPi

I tried controlling the servo with softPwm using the wiringPi Library but this made the servo stutter. Therefore I want to use the hardware PWM pin on the Raspberry Pi (GPIO18) with the wiringPi ...
4
votes
2answers
4k views

100% processor usage with WHILE loop in Raspberry Pi

I am using wiringPi Library and using this library to read data from GPIO Pins attached to a PIR Sensor. I am using a while loop which reads input data. If there is a motion it will print motion. ...
21
votes
3answers
69k views

Control Hardware PWM frequency

I'm using the hardware PWM output with wiringpi. It provides the function pwmSetClock that should make it possible to change the frequency. (https://projects.drogon.net/raspberry-pi/wiringpi/functions/...
4
votes
1answer
5k views

Read the value of an GPIO output pin

I've made a program using the wiringPi library that assigns GPIO pins to toggle at the press of associated number keys. I'd like my program to show the current status of the pins, even if they are ...