Language: C++
Relevant Libraries: SDL2, OpenCV4, Serial
Application Objective: I’m putting together an application where I move a cursor with a game controller and overlay it onto the camera stream and show it, aditionally I want to receive some data from an Arduino Mega. The arduino just sends a value from -1000 to 1000 and I want to show it in the screen too.
What does work: I made work the first part, Talking with the remote controller via USB or Bluetooth and showing that info onto the screen over the camera stream using gstreamer.
The code:
program_test_WORKING.cpp (5.4 KB)
I installed the Arduino IDE into my Nano to check the serial port was working and indeed, the Nano was receiving the expected data from the Arduino.
I found an example using this library here . And it works fine.
I ran both working applications in parallel and they work fine separately.
What does NOT work: Now If I put part of the Serial code into the Camera and Controller program, the program just crashes without showing anything
The code:
program_test_NOT_WORKING.cpp (5.4 KB)
I’m not an expert programmer, so I thought you might have an idea of what is happening here.