Using HAL level C++ Programming

It’s been years since I programmed in C++, but I believe it will serve me well with the Matrix Creator.

Looking at the examples’ code, I’m good with it. What I don’t know is the recipe for "MAKE"ing a file.

Can anyone give me some bullets on how to alter and make a c++ file.

For example, if I were to change the temperature sensor readout in “sensors_demo.cpp” from C to F in the .cpp file source. What would I type to compile it into an executable that I could copy to a directory of choice?

Thanks,
Sean

the demos can be compiled with cmake as described in the repo, but you can do this also manually.
change the includes and compile it with g++

#include "fw_data.h"
#include "humidity_data.h"
#include "humidity_sensor.h"
#include "imu_data.h"
#include "imu_sensor.h"
#include "matrixio_bus.h"
#include "mcu_firmware.h"
#include "pressure_data.h"
#include "pressure_sensor.h"
#include "uv_data.h"
#include "uv_sensor.h"

compile:
g++ -o sensors_demo -I /usr/include/matrix_hal -O /usr/lib/libmatrix_creator_hal.so sensors_demo.cpp

you need the libmatrixio-creator-hal and libmatrixio-creator-hal-dev installed. if you are familar with other programming languages e.g. python, nodejs you can use this to access the devices.

Very nice-worked perfectly.

Thanks!

-Sean