Questions tagged [wiringpi]

WiringPi is a C language library for accessing GPIO pins.

Filter by
Sorted by
Tagged with
21
votes
3answers
65k 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/...
6
votes
3answers
735 views

Is this behaviour of GPIO pins normal?

I am using this tutorial: https://www.youtube.com/watch?v=b6ZagKRnRdM to connect that relay board to my PI, everything works fine, but I have noticed that till the GPIOs are set to out the 2 smd leds ...
6
votes
3answers
13k views

SPI: Raspberry PI master and Arduino slave

I'm trying to have a Raspberry PI act as a SPI master and send data to an Arduino Nano (one of the cheap clones). I partly succeeded, but I don't get a continuous communication, and some bytes get ...
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 ...
5
votes
1answer
3k views

Using BCM GPIO pin numbers with wiringPi C library

I'm a GPIO newbie experimenting with getting my Raspberry Pi to blink an LED with C using the wiringPi library. The example code at http://wiringpi.com/examples/blink/ (blink.c) compiles perfectly and ...
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 ...
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. ...
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 ...
4
votes
2answers
3k views

GPIO pins not changing value

I have a raspberry pi zero and I am trying to change the gpio pin values. I tried using RPi.GPIO with python and the gpio command from wiringpi but I am unable to change the value for any of the pins. ...
4
votes
2answers
2k views

gpio not working

I'm quite new to the Raspberry world, and I cannot figure out what's not working on my tiny test project on my B+. I connected a red LED to the 3v3 (pin#1) and a resistor to the ground (pin#6), and ...
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 ...
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 ...
3
votes
2answers
4k views

I2C using wiringPi or IOCTL in C, more than 2 bytes

I'm willing to send 20 bytes at a time to Arduinos via I2C bus. I'm writing a C program (that will become a Daemon) that should achieve this, and thus I downloaded via Git the last wiringPi library, ...
3
votes
1answer
305 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 (...
3
votes
5answers
5k views

WiringPi error etates I'm not Using an RPi

Unable to determine hardware version. I see the following error message: expecting BCM2708 or BCM2709. If this is a genuine Raspberry Pi then please report this to projects@drogon.net. If this ...
3
votes
1answer
844 views

Using WiringPi with Jasper (voice recognition)

I am using Jasper. The voice control part works, however the function I call when a certain word is said, does not. I'm trying to control a robot, sending high signals to certain pins on an L293D ...
3
votes
1answer
1k views

Cannot read 433Mhz data

My goal is to use a 433Mhz receiver to capture the KlikAanKlikUit (Kaku/CoCo) ID. I have it wired to 5V and GPIO4. When reading up on the subject there are a few tools to capture data and even ...
3
votes
1answer
2k views

Printing state of wiringpi pin onto webpage

I have a Pi set up with Apache and wiringpi, and I would like to read the state of an in pin (every 20 seconds, if possible) and display it on my webpage using PHP. The input is to determine if my ...
3
votes
2answers
1k views

What is the byte order for the WiringPi 16 bit I2C reads and writes?

The WiringPi library has APIs called wiringPiI2CWriteReg16 and wiringPiI2CReadReg16 for writing and reading 16 bits of data from a given I2C device at a specific register. Since the resulting 16 bit ...
3
votes
1answer
175 views

Can't find out why my program won't read analog values (Using MCP3004)

I am using wiringPi and C. I have a flame sensor and a MCP3004 ADC. Here is the program that I wrote, but I can't figure out why it won't read the analog values from the flame sensor. #include <...
3
votes
0answers
793 views

Not getting a response from a connected PIR sensor

I have a PIR sensor which I'm using connected to a Raspberry Pi 3 Model B as part of a Magic Mirror project. I'm running this module for the sensor. I've had the Motion Sensor working before, but now ...
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 ...
2
votes
2answers
1k views

WiringPi: change output of GPIO pins synchronously?

I'm struggling to figure out how the WiringPi C library manipulates the GPIO hardware. Is it possible to change multiple output pins on the GPIO simultaneously in C using the library? For example, ...
2
votes
2answers
6k 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....
2
votes
1answer
339 views

Output Accurate, Detailed PWM signal

I'm building a quadcopter using the RPI 2 Model B. I'm currently using the Pi4J library (Java library that wraps the WiringPi library) for my project. All is going well except my ESC (Electronic Speed ...
2
votes
2answers
2k views

How can I use a usb barcode reader with my raspberry pi

I want to get a WCR3237-700 ID Tech USB card reader and attach it to my raspberry Pi. The end goal is to use it to unlock a magnetic lock (when the correct card.) I am currently running PHP scripts ...
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 ...
2
votes
1answer
2k views

WiringPi pin numbering for RPi 2B and 3B? [duplicate]

What is the pin numbering for WiringPi on the RPi model 2 B and 3 B? The pin page on wiringPi only gives the numbering for Pis with 26 GPIO pins. This is not a duplicate because the WiringPi library'...
2
votes
2answers
996 views

wiringPi and crosstool-ng

I have a Problem using wiringPi with crosstool-ng. First I got this Error: libwiringPi.so: file not recognized: File format not recognized I think the problem might be that ./build will not use ...
2
votes
2answers
2k views

Project needs multiple PWM

I'm working on a project that needs three (or more) PWM pins to work. But unlike Arduino, the Raspberry PI B+ has just one PWM pin. I've searched for solutions and I found that I can use the WiringPi ...
2
votes
2answers
12k views

How to read Wiegand card ID?

I need a simple script that outputs ID of presented card in console. I tried a lot of opensource code that based on WiringPi library, e.g. Pidoorman, its forks by Kyle Mallory and E.J. Dyksen, RFID ...
2
votes
2answers
2k views

SystemD unit dependencies to start wiringPi GPIO application

I want to start an application on system boot as early as possible. I am using Debian jessie. The application makes use of GPIO pins with the help of the wiringPi library. When using the following ...
2
votes
1answer
2k views

Max SPI transfers / sec speed using WiringPi

I'm trying to interface with MCP3002 ADC using SPI and it's working nicely except for the amount of the samples I'm able to collect per second. I'm using WiringPi and the code is very simple: ...
2
votes
2answers
648 views

GPIO Broken - cannot power - depower pins

I got my pi2 this weekend and started experimenting. Now I tried adding LEDs to the GPIOs the way I know it from arduino and all the forums do it. Pin>LED>270 Ohm>GND I attached two: pin 17&27 (...
2
votes
1answer
862 views

GPIO HW PWM @ 143Hz and 20-80% duty cycle, with WiringPi's gpio utility

I've tried to find the solution from other threads but they all seem to miss the point to a certain degree, usually going into kHz and MHz, or into the SW GPIO territory that I don't need. I have a ...
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
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 ...
2
votes
2answers
82 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 ...
2
votes
1answer
851 views

Should some GPIO pins read high from start?

I have a Raspberry Pi 2 Model B. When I power it, with nothing connected to the GPIO pins and the OS still not booted (probably, I checked right after plugging it to the power) some of the pins show ...
2
votes
1answer
460 views

Is it possible to speed up code processing time by increasing i2c baudrate?

Is it possible to speed up execution time of a c++ program in raspberry pi solely by increasing the i2c baudrate and increasing the sampling frequency of the sensors? I have the issue of sudden ...
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 ...
2
votes
1answer
98 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 (...
2
votes
1answer
121 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 ...
2
votes
0answers
2k views

pilight send raw code [433MHz]

I have set up a 433Mhz receiver and sender at my raspberry pi using pilight in order to remote control a power socket (Flamingo FA500S). Unfortunately, this one is self-learning and therefore not ...
2
votes
1answer
462 views

Raspberry PI Uart: pi to pi communication (B+, B2, CMIO)

Good day I am currently setting up UART communications for two Raspi's using wiring Pi's uart library. I have three Raspberry Pi's (B+, Compute Module IO board, B2). I have been able to make ...
2
votes
1answer
305 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'...
1
vote
3answers
639 views

GPIO - Is there someway to make the GPIO mode permanent?

Is there someway to make the changes from the GPIO utility permanent? Right now if I restart my RPi the changes revert back. I know I can use a script, but is there someway I can make the script start ...
1
vote
2answers
2k views

Using Wiringpi in crontab to control GPIO pins on RaspberryPi

I am trying to create a cronjob, which sets the GPIO pin 10 to high at a given time. I am using the crontab of the default user "pi" and have verified, that the command gpio -g write 10 1 works ...
1
vote
2answers
71 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 ...
1
vote
1answer
923 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 ...