QB Robotics qbmove Advanced Kit User Manual page 76

Table of Contents

Advertisement

g++ qbmove_example.cpp libqbmove_comm.a -o qbmove_example
.\qbmove_example
Code:
#include
<iostream>
#include
<string.h>
#ifdef
_WIN32
#include
<windows.h>
#else
#include
<unistd.h>
#endif
#include
"include/qbmove_communications.h"
#define
TRUE
1
#define
FALSE
0
int
main
(int
argc,
char
serial_ports[10][255];
int
serial_ports_count = RS485listPorts(serial_ports);
if
(serial_ports_count <= 0) {
std::cout <<
return
-1;
}
for
(int
i=0; i<serial_ports_count; i++) {
std::cout <<
}
comm_settings file_descriptor;
73
28 aprile 2021
This is not a complete program that use the device with all its capabilities
but it is only an example to see what is the correct order of functions and
what functions should be used to integrate the device within your system.
This example is tested on Linux OS. To run in Windows OS install the MinGW
and cmake utilities as described in previous section and then run:
g++ qbmove_example.cpp libqbmove_comm.a -o qbmove_example
qbmove_example.exe
char**
argv) {
"ERROR: \tno serial port found"
"INFO: \tserial port "
<< std::endl;
<< serial_ports[i] <<
" found."
<< std::endl;

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the qbmove Advanced Kit and is the answer not in the manual?

Questions and answers

Table of Contents