Questions tagged [c++]

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

2
votes
1answer
59 views

outb() equivalent in Python for GPIO

I am a very beginner on programming and raspberry usage, tho I think I learn fast. I am trying to convert an old program (not mine) that was written for Linux on C++ for communication with a printer ...
0
votes
1answer
25 views

sqlite3 cannot find -lsqlite3

I'm using raspberry pi 2B with raspbian lite. I'm trying to add an sqlite3 library on my C++ program. Without starting adding any piece of code, using the flag -lsqlite3 I get the error. src/main....
1
vote
1answer
20 views

C++ Qt5 / OpenGL issue when compiling a program that uses glGetTexImage()

I am on latest Raspian release with latest Qt5 pkgs and related OpenGL + MESA pkgs installed from the standard Raspian repo. I am attempting to build a C++ program (not mine) that relies on Qt5 and ...
1
vote
0answers
20 views

I want to know about printing NFC tag time out

I used libnfc and nfc-poll command. I get a UID and something else can I get a information about NFC tag time and print it out?
1
vote
1answer
44 views

Qt Userland raspistill/racpicam integration - Unable to find an X11 visual which matches EGL config

I am developing simple gui app for a client on Raspberry pi running Ubuntu(Mate) 16.04 using Qt 5.5.1 and OpenCV for some face recognition (all C++) using 5MP pi camera. The framerate/CPU usage ...
-2
votes
1answer
47 views

Ensure/lock a program to run on Raspberry Pi only?

Are there any characteristics/ lock available so that the program would fail to run on any other device except Raspberry Pi. I have thought about using GPIO with external circuits but would prefer ...
1
vote
1answer
75 views

SPI sending function

I'm currently reworking a project from someone who graduated a few years back and I'm supposed to change the function of his work for a bit. I have trouble understanding these few lines from SPI ...
0
votes
0answers
31 views

HD44780 Display and wiringPi

I have wired a display to the raspberry pi, which uses an HD44780 controller. The wiring was verified by using this python script: https://www.raspberrypi-spy.co.uk/2012/08/20x4-lcd-module-control-...
0
votes
1answer
104 views

Several serial ports with c++

Trying to work on Raspberry Pi 3, Model B V1.2 with several serial ports with C++ code. Previously I should say that when I use only one ports everything works like a charm, so ports configuration is ...
0
votes
2answers
68 views

Is it possible to compile and Arduino Sketch into a C++ file to run on Raspberry Pi?

Since Arduino uses C++ for its programming with libraries that are specific to Arduino, is it possible to compile your sketch and have it run as a C++ program on a Raspberry Pi? I saw there was ...
0
votes
0answers
58 views

Raspberry Pi 3 Model B - Windows IOT - UWP C++ - Servo control?

So currently, I have already developed a uwp application in Visual C++. I ordered a raspberry pi 3 model b from Amazon and its expected to arrive on Wednesday. In my program, I have a button, when I ...
0
votes
0answers
16 views

Is it possible to use Adafruit's Arduino libraries for my Raspberry Pi alone? [duplicate]

I have a MPR121 touch sensor, LSM303DLHC accelerometer & magnetometer, & SSD1306 128x64 display, and I don't have a Arduino.
2
votes
1answer
275 views

Problem with gcc/g++ versions

I'm currently setting up Homebridge to run on my Pi using this installation guide. I have run into a problem regarding the C++ compiler section; I understand that this part of the guide is out of ...
1
vote
0answers
71 views

Any DS3231 RTC C++ experts here?

I'm trying to program a DS3231 using a translated C++ Arduino Mega 2560 library. Translated means all the Arduino I2C methods have been changed over to use the BCM2835 GPIO/SPI/[I2C] library. The RTC ...
0
votes
1answer
35 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
0answers
31 views

Generating multiple square waves simultaneously

I'm trying to generate 2 simultaneous square waves (50% duty cycle PWM signals) to step two stepper motors (STEP signal to separate motor drivers) on the Raspberry Pi Zero W. I use GPIO12 and GPIO19, ...
0
votes
1answer
58 views

HC-SR04 Sensor stops reading

I am working on HC-SR04 ultrasonic sensor for my project. I made the connections given here. Here is my code int main(){ int count = 0; if (gpioInitialise() < 0) { qDebug() << "...
-1
votes
1answer
109 views

Data logging in Raspberry Pi

I have made a C++ program which communicates with an RFM95 LoRa module and listens to messages from a various transmitters nearby. Those transmitters transmits sensors' data like temperature, humidity,...
1
vote
1answer
193 views

What is the pixel format for Raspberry Pi framebuffer

Good afternoon, I'm trying to programmatically display an image to a 3.5 inch TFT display mounted on /dev/fb1 using the following code: Using trial and error I determined the pixel width to be 16 ...
5
votes
0answers
108 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
91 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
290 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
469 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
323 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
2answers
362 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
551 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
1k 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
394 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
358 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
127 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
758 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
166 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
309 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
74 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 ...
3
votes
1answer
1k views

Pi 3B+ jack audio inputs and low latency

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
571 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
723 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
204 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 ...
1
vote
2answers
405 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
2k 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
185 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
2k 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
889 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
326 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
301 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
1answer
519 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
213 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
161 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
357 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
860 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 ...