In C or C++, a table is implemented via an array. Learn about arrays.
However, there is little need to use predetermined values unless speed is of the essence. The Arduino can calculate the correction factor (adjustment) based on the temperature and use this to correct the wind speed.
Oh so this code needs to go in the setup section and not the loop. In my head I was wondering how I could get it back to the top. Well durn, This sounds like a fun experiment. I was on the fence about ordering this sensor until I could make sure this would work.
Seasea19:
Oh so this code needs to go in the setup section and not the loop. In my head I was wondering how I could get it back to the top. Well durn, This sounds like a fun experiment. I was on the fence about ordering this sensor until I could make sure this would work.
Thanks!
Ken
the code should be placed in the loop not in the setup
setup only runs once then moves to the main loop. As you want the calibration number to change based on temp then it will need to be tested more than once
float zeroWindAdjustment = 0.0; can go in the loop but must be placed before anything trys to use it with in the loop. Or it can be placed before setup and used as a global.
You need to remove the const as that stands for constant which means its read only and you want to be able to change it.
personally I would make it global as you may wish to move the calibration code to a function later