Questions tagged [c++]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

C++ programming - Class for Motor rotation and control for washing machine embedded system device layer error?

#include <iostream> using namespace std; int main() { // declaring variables: int MotorControl; int MotorRotation; MotorControl = on; MotorControl = off; // process motor control and ...
1
vote
0answers
14 views

How to update GTK3 image using a button to capture a picture from the camera using C++?

I managed to create a program that will display some buttons and and Image. Now I would like to update the image when a button is clicked. How do I do that? Here is what I have so far, it all works ...
1
vote
4answers
30 views

Cannot run 2 apps with rc.local but it works from command line

I have 2 apps, lets call them /home/pi/app1 and /home/pi/app2 If I type into console sudo /home/pi/app1 & sudo /home/pi/app2 both apps execute without issue When I add the same line to /etc/rc....
1
vote
1answer
53 views

OpenCV Gstreamer pipeline doesn't work on Pi 4 Buster

I'm studying about object tracking and detecting in Gazebo Simulation. So, I'm trying to send Simulation video(Gst Plugin) to Raspberry Pi 4 via ethernet cable over UDP stream. And Pi 4 side, catch ...
0
votes
2answers
63 views

Raspberry Pi 4 B g++ undefined reference to boost::system::system_category()

I created a simple program in C++ on my RPi to test the Boost library. This is the code: #include <iostream> #include <boost/asio.hpp> int main() { std::cout << "Hello World!" &...
0
votes
1answer
46 views

Duplex communication via bluetooth - in C++ code [closed]

I have a working C++ code , partially converted to class, passing single (text char ) message form client (Rpi) to server (PC). I have used a composite ( fancy work for hack ) of many C/C++ code ...
0
votes
1answer
25 views

polling gpio raspberry 2 doesn't work

i'm writing a library for my raspberry pi 2 for gpio control. I'm trying to test a function for read a gpio driven by interrupts with sysfs but i can't do that my function stops in poll() function. ...
1
vote
0answers
21 views

pigpio library dependencies missing when compiling Radiohead nRF24 library

I am using Eclipse 2019-06 CDT to compile the Radiohead nRF24L01 library (v1.97) using the pigpio interface (v71) with C++. I get the following errors: rpi/rfs_pizw2/usr/lib/libpigpio.so: undefined ...
2
votes
0answers
31 views

g++ and gdb debugging does not provide full backtrace

I never experienced this behaviour on classic desktop platform thus I'm asking here. The question is how to correctly debug C++ application (g++ build) using GDB on Raspberry Pi? When my application ...
0
votes
1answer
65 views

C++ Long Double or equivalent on ARM64

I'm having a hard time getting a straight answer about long double precision on ARM64 architecture. I'm engineering a scientific machine requiring extreme precision, and the driver, which I will write ...
0
votes
0answers
46 views

Running a visual studio 2019 c++ code with cryptopp library on raspberrypi for performance analysis

I've written a code in visual studio 2019 in c++ language and it involves various cryptographic mechanisms. It also includes Elliptic curve library named cryptopp. I want to simulate and test the ...
0
votes
1answer
121 views

Running Visual C++ on raspberry pi

Can we run a program written in visual studio c++ (windows), with or without the rasp-bian OS? Any guidance about how it will be done? What software will be needed?
0
votes
0answers
40 views

How to link gmp to g++ on Raspberry?

I attempt to compile a small code that uses bitcoin.hpp with the line g++ -o file file.cpp $(pkg-config --cflags --libs libbitcoin) and get an error related to gmp. /usr/bin/ld: /home/pi/libbitcoin/...
1
vote
0answers
199 views

Cross-compiling for Raspberry Pi I fails using Linaro 7.4.1 toolchain

I downloaded the latest Linaro toolchain (https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/) to cross-compile C++ code for different Raspberry Pis which running a ...
0
votes
1answer
77 views

How to use at the same time 2 hardware pwm in wiringpi

I need help to configure 2 hardware PWM channels. I am developing device, and sometimes I will need active 2 PWM channels with different frequencies (frequencies is low: 410 and 580 Hz).I'm writing ...
0
votes
0answers
20 views

Looking for suggestions digital price cards

Hello fellow raspberry pi users I am looking for suggestions in getting a raspberry pi 3 to create digital pricing for our locations. The idea is to have it pull the price for products from a google ...
2
votes
1answer
149 views

see output from c++ program which was started by rc.local

is there a possibility to see output (f.e. std cout << ...) from my program which was started from rc.local script when i am logged into my Rpi via SSH?
1
vote
1answer
243 views

Programming MLX90640 to display what I want [closed]

Yay. Got my MLX90640 working and boy it works great. However, the ambient temp of around 20C keeps showing as a green background and i would like it to be blue or even grey. Has anyone attempted to ...
3
votes
2answers
621 views

C++ problem: boost/asio.hpp non existing

I'm using Raspberry Pi 3B+. I'm trying to compile a rather massive C++ package given to me from somewhere else. However make fails compiling. It cannot find boost/asio.hpp. I simplified the problem ...
3
votes
1answer
430 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
230 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
72 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
29 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
134 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
64 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
107 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
55 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
373 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
93 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
106 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 ...
2
votes
1answer
975 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
165 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
76 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
1answer
102 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
312 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
481 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
142 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
164 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
420 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
903 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
535 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 ...
1
vote
2answers
478 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
778 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/...
1
vote
1answer
2k 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
568 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
476 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
173 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
1k 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
243 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
562 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 2 3 4 5