Simple project that exposes different executables which are able to send the string "e"
through the serial port /dev/ttyUSB0
and print the response.
It was mainly used to test the communication with the microcontroller (in an Arduino Nano board) in the Andino robot. The string "e"
is parsed by the microcontroller, which reads the two wheel encoders and send the values back via serial port.
The Andino project itself contains a more involved demo application to test this behaviour which uses the LibSerial library.
Although the example uses the Andino project as a reference, the code present in this project can be used to send any other types of messages via serial port if adapted.
Steps used to create this project using Pixi version 0.53.0.
pixi init cpp_serial
pixi add cmake boost_asio
pixi add --feature build cxx-compiler ninja
pixi workspace environment add build
pixi workspace environment add build --feature build --solve-group default
Then the tasks sections (tasks.start
, feature.build.tasks.configure
and feature.build.tasks.build
) were added manually, directly in the pixi.toml
file.
Followed the example structure for the cpp-sdl example project.
Navigate to the project root directory and run:
pixi install
pixi run configure
pixi run build
There are 2 versions, all of them have the same logic but use different libraries/approaches:
- Using Termios:
pixi run start_termios
- Using Boost.Asio:
pixi run start_boost