Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

For questions pertaining to compiling c++ programs on the Raspberry Pi.

0
votes
0answers
10 views

press s to start with a counter in seconds and tap photo in 0 seconds and then one in 5 seconds with counter picture

press s to start with a counter in seconds and tap photo in 0 seconds and then one in 5 seconds with counter picture. I'm not able to put a counter just my name. What this code is doing is ...
3
votes
0answers
36 views

Raspberry as I2C Slave, how to slow down transfer rate?

I have had minor success using the PIGPIO library and interfacing the Pi as an I2C Slave (Using GPIO Pins 18 and 19 as SDA and SCL) with a Campbell CR1000X Datalogger I am encountering a problem ...
2
votes
1answer
34 views

memory trouble compiling c++ on the rpi3b+

The compiler works great, there are 4 cores available, but if I use all 4 of them, invariably the memory runs out. Aside from uninstalling as many services as possible, compiling with a cross-compiler ...
-2
votes
1answer
67 views

How can I setup i2c on Alpine Linux? [closed]

There are tutorials all over the internet about how to enable i2c on Rasbian using raspi-config, but I'd like to work with Alpine Linux. How do the i2c devices/drivers/kernel modules work and how can ...
1
vote
1answer
80 views

SPI only returning zeros with Raspbian (It works with IoT core)

I am using this ADC connected to the channel 0 of my Pi3 board for reading values from a sensor. In IoT core, I was using a very simple code for testing the my device, and it worked fine. The C# code ...
-1
votes
1answer
75 views

Showing an image on HDMI (DSI, HDMI screens connected)

I have a Raspberry Pi 3B device connected to a LCD '7 (7 inches LCD, its a touch screen I believe that's called DSI not sure) and also a HDMI screen. By default Raspbian considers the LCD as the ...
1
vote
1answer
93 views

Files not saving even with flush

I have a program that is intended to log the incoming data from a sensor. The sensor is reporting at 200 hz and needs to be logged at least that fast so there are no lapses in data. It is important ...
0
votes
1answer
128 views

Raspberry pi GPIO pinout diagrams diferent than BCM and BOARD?

I know what BCM and BOARD mean when you set up the pi to work with the GPIO coding in python. Recently a had a look in some code for raspberry written in c++ and everything is okay but how the code ...
0
votes
0answers
122 views

Invalid string offset errors when compiling RaspiCam C++ Library

I am getting these warnings with the RaspiCam C++ library, and wondering if anyone has a fix for them? My program is also crashing and I'm wondering if it's related. /usr/bin/ld: /usr/local/lib/...
0
votes
1answer
367 views

Access RPi's camera stream in OpenCV C++ (Qt)

I've setup my Raspberry pi 3 B with uv4l and have access to the video stream on http://(raspberry-IP):8080/stream address. Now, I have Qt5(C++) and OpenCV installed on my main computer. How can I ...
0
votes
2answers
174 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
105 views

Frequency bands from FFT (audio visualizer)

I'm currently working on an audio visualizer running on a 64x64 LED matrix, and some tests showed that the Pi1 is totally capable of doing that. I'm receiving raw PCM audio data using PortAudio, and I ...
0
votes
1answer
54 views

pigpio, update xfer.txBuf

Question refactored: Im currently struggling to understand how to update the transmit FIFO of the bsc_xfer. For reference: Slave side: int main(int argc, char** argv) { int GPIO = gpioInitialise();...
0
votes
1answer
202 views

PIGPIO wiring, basic i2c slave questions

I'm toying with pigpio and I can't find some informations: 1) I'm currently using a arduino uno to send bytes (as master) to a Rpi3 as slave, I currently use BCM2 as SDA (A4 on Uno) and BCM3 as SDL(...
1
vote
0answers
85 views

PortAudio is not listing my USB audio card

I'm having a weird issue currently, which I'm not too sure how to resolve as of right now. On my Raspberry Pi 1, there's a USB sound card connected, where I need the microphone input from (the pi is ...
2
votes
2answers
130 views

How to start an app without windows manager

Hi sorry for the answer I´m very inexperienced in Raspbian, just started to use the pi a few weeks ago, I need to start an app developed with Qt in C++, it has a GUI, this app has strict timing ...
1
vote
0answers
33 views

Installing a higiher version of GCC on Wheezy that doesn't rely on a newer glibc [closed]

We have software that we distributed to a bunch of Pis that have Raspian Wheezy. Recently, we've added in a bit of code that uses C++ standards that aren't integrated until >=gcc-4.8. If I compile on ...
1
vote
0answers
601 views

Pi 3B+ jack audio inputs

Related: Raspberry Pi 3 audio input? I need to be able to input several jack microphones (minimum 2, more could prove useful) to my raspberry, to do some audio processing (between all inputs), and ...
1
vote
0answers
405 views

Qt5.10.1 Cross-Compiled to Raspberry Pi Zero W uses EGLFS instead of XCB

I have been trying to create a GUI application using Qt5 on Raspbian Stretch, but the application doesn't launch correctly unless I specifically tell it to run as XCB. This is fine, as I don't need it ...
0
votes
1answer
307 views

C++ GUI development with graph support

So, I am developing a project in the RPi where I will be reading values from a sensor using I2C, and this values will be plotted in real time using a GUI. The project is strictly being developed C++ (...
0
votes
1answer
100 views

AVFrame YUV420P to dispmanx VC_IMAGE_YUV420

I'm using ffmpeg for decoding a video with h264_mmal encoder. And all test videos are in YUV420P color encoding. Also I'm using dispmanx for drawing frames from a video. Only problem which I have is ...
0
votes
0answers
133 views

Get wireless card information in C++

I want to use the built-in wireless card in ad-hoc and promiscuous mode, which, out-of-the-box, seems possible: The file /etc/network/interfaces: # interfaces(5) file used by ifup(8) and ifdown(8) #...
1
vote
2answers
232 views

RF24L01 - RF24 Creation Segmentation Fault in Raspberry

What I have Raspberry Pi 3 B RF24L01 RF24 Library TMRh20 How I've Connected It Based on the library indications: RF24L01 pin | RPi 3B 1 GND | 9 GND 2 VCC | 1 (3.3V) 3 CE | 15 (...
2
votes
2answers
921 views

Error while loading shared libraries: foo.so: cannot open shared object file: No such file or directory

I have cross compiled c++ code for raspberry pi. Below is process I followed: 1) Cloned the official toolchain from raspberry pi github. Set the environment variable of arm-linux-gnueabihf-c++ (in ....
0
votes
1answer
85 views

Can't read the right channel from MCP3008 in C++ using pigpio

I'm trying to use an IR sensor with Raspberry Pi and I have this function to read a specific channel from the ADC MCP3008. When I try to read any other channel but channel 0, it doesn't work. What I ...
1
vote
2answers
614 views

Cross compiling from Fedora 27

I'm attempting to cross-compile a C++11 project for my Raspberry pi. In my searching online, I have come to the conclusion that I need the g++-arm-linux-gnueabihf compiler (please correct me if I am ...
1
vote
1answer
599 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 ...
0
votes
0answers
167 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 ...
0
votes
1answer
125 views

Cross-compiling with nfs-mount as sysroot fails due to absolute links

I want to cross-compile C++-applications for the raspi using the rpi-tools, CMake and a raspbian sysroot I'm exporting via nfs from a running raspi. My CMake-toolchain-file is OK, header-files and ...
0
votes
0answers
225 views

Pi camera board return black screen using connection via Opencv 3.3 C++

I am using Raspberry Pi 3 with pi camera board and I want to use opencv(c++) VideoCapture to connect with the camera but it return black screen image. I already enable camera in rpi-config and install ...
0
votes
1answer
303 views

pigpio spiXfer in C++

I'm trying to communicate with MCP3008 ADC via SPI using "pigpio" library. Basically I'm trying to read an IR Sensor and I've managed to do it manually by sending the required signals but I can only ...
0
votes
1answer
93 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 ...
0
votes
1answer
117 views

What libraries/code to I need to use a MyoWare muscle sensor with a Raspberry pi?

My robotics class is trying to take signals from a MyoWare Muscle Sensor and feed them to a Raspberry Pi Zero. For ADC, we are using a MCP3008 chip. Because most people use Arduinos for these sensors,...
1
vote
1answer
170 views

Beginner C++ Books on using Raspberry Pi [closed]

There seems to be a shortage of books out there on using C++ with Raspberry Pi! I could literally only spot two, which I will paste below: https://www.amazon.com/Exploring-Raspberry-Pi-2-C/dp/...
1
vote
1answer
417 views

Taking input from a MyoWare muscle sensor with a Raspberry Pi Zero

Our robotics class is making a robotic hand that takes input from muscle sensors. We have a Raspberry Pi Zero and are trying to take muscle activity input from a MyoWare Muscle Sensor. The program we ...
0
votes
0answers
150 views

Is it possible to read MPU 6050 gyroscope 0 to 180 and 0 to -180 Yaw values using pigpio raspberry pi library?

I want to read MPU 6050. I am using the raspberry pi to read it using the pigpio library. Now using MPU6050_6Axis_MotionApps20 i2c library I am getting 0 to 180 and 0 to -180-degree gyroscope Yaw ...
0
votes
1answer
27 views

SD to USB Adapter: Will the SD card appear as a USB device?

My colleague and I are writing an endurance test for SD cards (running read/write/erase block cycles). We're considering using an Raspberry Pi 3 to run the tests on. The issue is we will be using ...
1
vote
1answer
327 views

How to read two rotary encoder data using pigpio c++ library in raspberry pi?

#include <iostream> #include <pigpio.h> #include "rotary_encoder.hpp" void callback(int way) { static int pos = 0; pos += way; std::cout << "pos=" << pos << ...
-1
votes
1answer
97 views

How can I move my normal c++ main() function code to qt main function?

I have created small normal c++ code to test in raspberry pi which is working perfectly fine on the terminal.Now I want to write it down in qt, the problem here I am facing is I can able to move my ...
0
votes
1answer
172 views

Slow pixel drawing with SDL2 & experimental OpenGL driver

The code bellow just polling mouse events and draw lines between the previous and last mouse coordinates in case of left mouse button pressed down, nothing special and its using only fast integer ...
3
votes
1answer
2k views

Raspberry Pi 3 and V4L2 C++ Capture Code for JPEGs

I have a Raspberry Pi 3 with the latest Raspbian Stretch, and the Sony 8MB official camera. I can save a good looking JPEG with the following commands: v4l2-ctl --set-fmt-video=width=2592,height=...
0
votes
0answers
26 views

mraa uart failed to setup

I've installed and built mraa: https://github.com/intel-iot-devkit/mraa I've compiled and ran uart.c in examples folder. But I get this error message: "UART failed to setup" I've found that it may ...
3
votes
1answer
142 views

Does select/multithreading make sense when dealing with multiple DS18B20 and GPIO reads simultaneously?

As you may know, DS18B20 is not the quickest sensor and answers after around 750ms delay but, afaik, 1-wire is a relatively quick bus. I have multiple sensors connected to the board, which means if I ...
4
votes
1answer
2k views

Raspberry as an I2C SLAVE

Does anyone know how to setup a Raspberry Pi 3 as an I2C slave (in C++)? Before someone answers saying that it's not possible, it is possible. Here is a link that says it is possible (pigpio ...
1
vote
1answer
197 views

HC-SR04 distance = 0 using pigpio in C++

As the title says, the distance in my sonar is giving me 0, I think I found out the problem, but the code was working fine with wiringPi. Functions: I only changed names to be equal to Arduino ...
1
vote
1answer
366 views

RaspberryPi 3 pigpio not functioning properly in C++

I was messing arround with PWM and wiringPi in C++ language, but I found out that there was a better library (might be the most updated) called pigpio. Since I was new to this I was trying to the the ...
0
votes
1answer
1k views

Use c++ on raspberryPi3 [duplicate]

Is there a way of using c++ on the raspberry pi without having to use the terminal and the compiler directly? I would like to know if there is an IDE avaiable like Visual Studio,eclipse etc... I'm ...
1
vote
2answers
273 views

I2cReadByte, bad handle, Pigpio c++ Library

I recently bought on ebay a sensor for a drone project im working on MPU9250 BMP280 10DOF the thing is i always get a "bad handle" error, and honestly i cant figure it out. 2017-11-18 22:10:03 ...
2
votes
1answer
2k views

Increasing fps of pi camera using OpenCV C++ implementation

I am using a NOIR Pi camera for my Raspberry Pi 3 module. I plan to run some high fps image processing algo using openCV in a C++ environment. However, I cant seem to obtain the video stream in a high ...
2
votes
1answer
1k views

Running Modern Opengl on raspberry pi

Is there any way to "enable" modern OpenGL on the Raspberry Pi (specifically the Raspberry Pi3)? I would like to use C++ instead of Python, since I'm a lot more familiar with it. I know there is a ...