Questions tagged [wiringpi]

Question regarding Wiring Pi - a GPIO Interface library for the Raspberry Pi

Wiring Pi - a GPIO Interface library for the Raspberry Pi

WiringPi is a PIN based GPIO access library written in C for the BCM2835, BCM2836 and BCM2837 SoC devices used in all Raspberry Pi. versions. It’s released under the GNU LGPLv3 license

Site: http://wiringpi.com/

Reference: http://wiringpi.com/reference/

Download: http://wiringpi.com/download-and-install/

Github: https://github.com/WiringPi/WiringPi

145 questions
0
votes
1 answer

How to read a float value in C on Raspberry Pi 3B from Arduino slave (via I2C)?

I have a float variable on my Arduino slave and I want to send it to my Raspberry Pi 3 Model B master. What I know is that I probably need to send an array of bytes from Arduino and then read it properly on my Raspberry Pi. I had no luck using this…
VapeKop
  • 349
  • 2
  • 4
  • 13
0
votes
1 answer

How to send a char array over serial which includes a NULL char?

I am using WiringPi-Python to send data over serial and trying to send a char array. My problem is; I cannot send the data if the array includes a 0 (NULL char). bytes = [112, 52, 0, 18] send = "".join(map(chr, bytes)) wiringpi.serialPuts(serial,…
pmundt
  • 57
  • 9
0
votes
0 answers

How to correctly ground a 12v device with Raspberry Pi

i have a (i think) very simple question. For my Raspberry i've bought a coin acceptor which needs a 12v power supply, the wiring is like this: now i'm quite unsure how i need to connect the Ground of the coin acceptor, do I need to connect it to…
Apple Web
  • 55
  • 8
0
votes
1 answer

Simple Makefile using WiringPi

I'm new to Makefiles. I've been making a simple C++ library using WiringPi for my RaspberyPi related projects. So far its very simple with things like an LED class, DuelLED, Motor, Button, etc (both .h and .cpp). I was able to piece together a…
Katianie
  • 589
  • 1
  • 9
  • 38
0
votes
3 answers

Process incoming serial stream without LF CR

The code below processes incoming RS232 serial data 1 character at a time and works fine. However the incoming serial feed in my use case does not contain any CR or LF characters which make further delimiting/processing to a piped program…
stackman
  • 3
  • 1
0
votes
1 answer

Use wiringPi with interrupts and lcd simultaneous

I'm new to C++ programming on Linux. I try to use an rotary encoder to control values on a lcd. Depending on which wiringPi Setup routine I use, only interrupts or the lcd work, but not both at the same time. I exported all necessary GPIOs so that…
Christoph
  • 1
  • 1
  • 4
0
votes
1 answer

Raspberry Pi 3 with wirpingpi - uart doesnt work

I want to communicate RPI3 with atmega8 via uart. In atmega I set 9600 baud rate, 8bits, no parity bit and one stop bit. I my rpi I'm using WiringPi library and this is my code: int fd; if ((fd = serialOpen ("/dev/ttyAMA0", 9600)) < 0) { …
Bambelal
  • 179
  • 1
  • 2
  • 13
0
votes
1 answer

C++ wiringPi Crash

I am trying to create a program that controls a servo motor using wiringPi. However, as soon as I call wiringPiSetupGPIO(); my Pi crashes. Any Idea why this might be happening? My code so far: #include #include #include…
0
votes
0 answers

Raspberry pi (3) shell script does not properly work when started by cron

I've created a simple shell script which basically just starts an ".jar" file. this script contains the following now=$(date +"%s") sudo java -jar /home/pi/Desktop/test.jar > /home/pi/Desktop/output_$now.txt I added the script to the crontask with…
JavaMan
  • 1,142
  • 12
  • 22
0
votes
1 answer

Raspi I2C communication with Arduino issues with wiringPi

I'm experiencing unexpected results using wiringPi's wiringPiI2CWriteReg16() function, and I'm not sure if it's due to incorrect usage, or something else. This is the declaration for the function: extern int wiringPiI2CWriteReg16 (int fd, int reg,…
stevieb
  • 9,065
  • 3
  • 26
  • 36
0
votes
2 answers

Convert binary signal to int number

I'm trying to convert the input of the GPIOs of a raspberry pi to a int. So I have five digital inputs and want to read the inputs. Once i got the values I store them in an array. The next thing would be to convert the content of the array to a int…
user3794592
  • 183
  • 2
  • 16
0
votes
2 answers

RPI Drive servo by PWM (wiringpi / C programming)

I trie to drive a servo with the Raspberry PI using the PWM on GPIO Pin 18 i wired the setup like you can see below. When i drive the servo i can do this without any problems the commands that i use you can see below. gpio -g mode 18 pwm …
sanderfcb95
  • 59
  • 1
  • 12
0
votes
0 answers

Can't find out why my program won't read analog values

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 #include #include…
paulaxa1
  • 1
  • 1
  • 8
0
votes
1 answer

Raspberry Pi B+, l293d and two dc motors, variable speed with PWM, code in c/c++, but not working

Here my Code, it run, no errors, but no rotation on wheels. My Setup: 1. Raspberry Pi B+ 2. L293D for dc motors 3. two dc motors 4. use wiringPi library Example 1: #include #include #include using namespace…
david
  • 83
  • 1
  • 13
0
votes
1 answer

implicit declaration of function 'wiringPilSR'

I'm trying to attach an interrupt to a pin using wiringPI's wiringPilSR. My code looks like this: #include #include int inPin = 3; void myInterrupt(); int main(vodi){ wiringPilSetupGpio(); pinMode(inPin, INPUT); …
Alexander
  • 921
  • 3
  • 12
  • 31