Forum Discussion
Altera_Forum
Honored Contributor
10 years agoThe lookup table for the ADC value and associated temperature in Celsius is here: https://www.altera.com/content/dam/altera-www/global/en_us/pdfs/literature/hb/max-10/ug_m10_adc.pdf (table 2-1). There is some curve fitting going on to cross reference the table to the lookup function. The value is store as alt_u8 (unsigned) so it must have been more intuitive for the code author to lookup positive values in the celsius_lookup_table array and then subtract 40 from the indexed value.