73
28 aprile 2021
g++ qbmove_example.cpp libqbmove_comm.a -o qbmove_example
.\qbmove_example
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
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**
argv
) {
char
serial_ports
[
10
][
255
];
int
serial_ports_count =
RS485listPorts
(serial_ports);
if
(serial_ports_count <=
0
) {
std
::cout <<
"ERROR:
\t
no serial port found"
<<
std
::endl;
return
-
1
;
}
for
(
int
i=
0
; i<serial_ports_count; i++) {
std
::cout <<
"INFO:
\t
serial port "
<<
serial_ports
[i] <<
" found."
<<
std
::endl;
}
comm_settings file_descriptor;
Summary of Contents for qbmove Advanced Kit
Page 2: ...www qbrobotics com ...
Page 15: ...12 28 aprile 2021 Figure 3 7 Snap on mechanism Figure 3 8 Examples of connection ...
Page 40: ...37 28 aprile 2021 ...
Page 63: ...60 28 aprile 2021 IMPORTANT Remember to power the qbmove or the chain before using it ...
Page 97: ...94 28 aprile 2021 This page was intentionally left blank ...