Skip to content

A simple project to test the microcontroller in the Andino robot using some alternative serial libraries

License

Notifications You must be signed in to change notification settings

gleniosp/cpp_serial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

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.

Project creation

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.

Setup

Navigate to the project root directory and run:

  • pixi install

Usage

Configure the CMake project

  • pixi run configure

Build the executable

  • pixi run build

Start the build executable

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

About

A simple project to test the microcontroller in the Andino robot using some alternative serial libraries

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published