Hello everyone. I am newer to programming but have learned ALOT the last few weeks just from reading and trial and error. I have almost my whole project done but then got hang up when I decided to add one extra feature; a transmission temperature sensor.
My circuit works fine, I am using a voltage divider with a automotive temp sending unit.
My analogRead values are trending properly when I Serial.print them ie: 212 degrees (out array) = about 556 (in array) and 68 degrees = about 945.
The problem seems to happen when the conversion to temp takes place “temp = multiMap(val, in, out, 19);”
At 68 degrees (room temp) the LCD or Serial shows 68 degrees, at 212 degrees (boiling) the LCD or Serial shows 333 degrees while showing the proper value of 556 for analogRead.
Any idea what is going on? My complete code is attached. The multMap function is all the way at the bottom.
Thank you for any help.
Working.ino (11.9 KB)