gain was easier, and it is across all pixels evenly.
i use a global variable SensorGaincommon to store value in it is a float.
void ExtractGain(){
worddata[0]= pgm_read_word_near(factoryCalData+0x0030);//we can get this value from eeprom, faster and more reliably
if (worddata[0]> 32767){worddata[0]=worddata[0]-65536;}//per document 11.2.2.4
SensorGaincommon=worddata[0];
MLX90640_I2CRead(MLX90640_address, 0x070A, 1, worddata);//we get from ram
if ( worddata[0]> 32767){worddata[0]=worddata[0]-65536;}
SensorGaincommon= worddata[0]/SensorGaincommon;
}
from terminal image you can see gain is calculated as well. this seems to not change much so i would say it needs to be read at least 1 time after changing analog resolution detail.
here is the math. this is same for all pixels. it also does not need to be updated that much
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.