Questions tagged [c++]

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

Filter by
Sorted by
Tagged with
11
votes
2answers
16k views

PiGPIO Library Example for Bit-Banging a UART

The PiGPIO library http://abyz.me.uk/rpi/pigpio/index.html mentions that one of it's features is "software serial links using any user gpio". I take this to mean that you can use it to generate a ...
10
votes
2answers
10k 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 ...
8
votes
1answer
2k views

Raspberry Pi Camera - When is it ready for next frame

When using apis like the C++ or raspicam api, you poll the camera with a grab(), or similar, method. When a frame is ready, the method returns. Is there a way of checking if the camera is ready ...
2
votes
3answers
9k views

How to enable SPI1 and SPI0 at the same time?

I have installed a LCD screen that use my SPI0 bus and I2C but i want to connect my RFID reader to the same raspberry. My lcd screen can you see here: https://www.adafruit.com/product/1601 SPI1 will ...
1
vote
2answers
698 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 ...
8
votes
4answers
23k views

Installing Raspberry Pi Cross-Compiler

I am attempting to get cross-compiling for Raspberry Pi working on my Ubuntu machine. During my initial attempts I was using the arm-linux-gnueabi compiler, which is available in the Ubuntu repo. I ...
3
votes
1answer
636 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
1k views

Is it possible to fix the “cannot find -lgcc” and “cannot find -lgcc_s” error messages when using arm-linux-gnueabihf-g++ as a linker?

I get the following error messages: ./Downloads/tmp/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux‌​-gnueabihf/bin/ld: cannot find -lgcc_s and Downloads/tmp/usr/bin/../lib/gcc/arm-...
4
votes
1answer
7k 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 ...
3
votes
1answer
549 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 ...
2
votes
2answers
6k views

OpenCV display image: window system doesn't support opengl

I have a project which uses the raspberry pi camera and openCV (also: ROS) to do some movement analysis. However, when I want to display the image (with the openCV API or a ROS node), there's an error ...
2
votes
1answer
771 views

C++ cout output on RPi 3B

I have these lines in a C++ program on a RPi 3B: struct bcm2835_peripheral { unsigned long addr_p; int mem_fd; void *map; volatile unsigned int *addr; }; struct bcm2835_peripheral ...
2
votes
1answer
942 views

How do I set the input focus to my SDL2 app?

I have a pretty simple program. I'm just trying to acknowledge keyboard/mouse events, but I'm getting no log output (inside my SDL_PollEvent loop). I'm running just basic Raspian (no X). #include <...
2
votes
2answers
394 views

How to run a script after bootup on RPi 4/Raspbian 10 (buster)

Im trying to run a script after bootup, when the desktop is shown. The script is rather simple: #!/bin/bash mkdir /home/pi/Desktop/test So in other words: This script is creating af folder "Test" ...
1
vote
2answers
555 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 (...
0
votes
1answer
2k 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 ...
0
votes
2answers
101 views

SSH into a running instance of an application

I have developed a line-following vision application for the raspberry pi, and I want it to run always, as the Pi is connected to a robot. I know how to edit the rc.local file so that the application ...
0
votes
3answers
1k views

Locking a C++ binary to the RPi serial number

I see that each RPi has a serial number that is accessible by reading /proc/cpuinfo. How secure is it for me to tie such serial number to my C++ binary when I want to lock that binary to a single RPi ...