How to import a long array of float constants into a project
Dear forum members,
I work on a project that repeatedly reads 3692 pixel intensity values from a linear CCD pixel-array. The readout process and export of the data via USB is working fine.
Now I want to enhance the application by multiplying each pixel value with its specific correction factor to compensate for the individual sensitivity. I struggle to find the right method to import the correction values from a text-file.
At first I tried to add a user include file that assigns the float values (in the range 0.90 to 1.10) to the array 'g_PixFactor' that is declared in the 'main.c' file. This approach produces errors like "re-definition of array 'g_PixFactor' ". I also tried to do the declaration and the assignment of the values in the include file, which gave other complaints.
My questions are:
- Is the concept of importing values by an include file a workable method to solve my challenge?
- Can a more experienced forum member provide me the steps to get the correction values from a file assign to the float array?
I already found out I need to specify the float constants with 'f' as suffix to prevent interpretation as int value.
Some background: I work on a PC with Windows11 and just have done a clean install of STM32CUBEIDE32 v 1.19.0 after I experienced many strange errors in pieces of code that were fine before the last upgrade. The target HW is a STM32H723VG on a WeAct board.
As always, thanks in advance for spending time on my request,
greetings from the Netherlands,
Fred Schimmel
