This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.8) | |
project(serial) | |
find_package(PkgConfig) | |
pkg_check_modules(SERIAL libserial) | |
add_executable(${PROJECT_NAME} main.cpp) | |
target_include_directories(${PROJECT_NAME} PUBLIC ${SERIAL_INCLUDE_DIRS}) | |
target_link_libraries(${PROJECT_NAME} PUBLIC ${SERIAL_LDFLAGS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fully working code for reading from serial port in Linux | |
// Tested on STM32F437ZG | |
#include <libserial/SerialPort.h> | |
#include <iostream> | |
using namespace LibSerial; | |
int main() { | |
SerialPort serial; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install build-essential | |
sudo apt install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev | |
sudo apt install ffmpeg | |
git clone https://github.com/opencv/opencv.git | |
mkdir opencv-build | |
cd opencv-build | |
cmake ../opencv | |
make -j$(nproc) | |
sudo make install |