CLI Example for Sensor Box Pro
- March 12, 2026
- 3 replies
- 1129 views
The sensor box pro is a neat device. If I use the CLI Example program and the USB cable, I can get 8000 data points per second, if I use a traditional C# program I get 8 data points per second.
The CLI yields dat files, which can be read with a simple C# program, although why you would mix 6 and 4 data groups is beyond my skill set to understand, but it is easier to use than Python and MEMS Set. And it is easier to do the byte data in C#. (It took less time to write this program than I spent trying to get Python to work.)
CLI Example makes me type enter to start. I have many ST.COM accelerometers all over the world and I am not going to type enter to start, but the main.cpp and main.h and the cmake lists file will not compile in CMAKE or Visual Studio. So I cannot fix the challenging feature.
Could we get VS SLNX file and the C++ code for this program as part of the SLNX so it is easy to take out the enter statement and break the output up into data sets that can be analyzed in near real time, like 8 seconds on a bridge in a snow storm in the middle of the night, whilst I am sound asleep 1000 miles away.
This will read your dat files. there is some junk in there as it took me a while to work out the byte structure as the documentation shows a nice picture, but it is without numbers.
I need to improve the routine to break up the bytes, but that is ok as long as the accelerometer is flat.
One looks for say 8 seconds of record, time for a truck to pass over the bridge, do a FFT preferably in Intel Fortran but who cares and the record the data. After a year you have 3 million records and we then have a good idea about the bridge.
I would upload a picture to show some output, but it will not let me.
Thanks.
<< Cannot include code as message cannot exceed 30000 characters. >>
The file type (.cs) is not supported. Valid file types are: ai, avi, mp4, bmp, csv, doc, cpd, docx, flv, gif, gz, tar.gz, har, ico, jpg, jpeg, log, mov, mpg, mpeg, mp3, odt, odp, ods, pdf, png, pps, ppt, pptx, rar, rm, tif, tiff, txt, xlr, xls, xlsx, xml, wmv, wav, z, 7z, ioc, hex, c, cc, cpp, h, hpp, tar, xz, dts, s, zip.
One is left to wonder. Ah, I compress to zip.
