With the ReadProportion method, you get a value on normalized scale [0;1].
The temperature scale in Celsius for that sensor is [-22;56]. So the measurement value in Celsius will be:
Since this eblock is expecting 5volts, you need to adjust the scale as well as the FEZ Spider analog inputs are 3.3v. Adjusting the line below yields the proper temperature
I know. I found this topic for something else I was doing and noticed it didn’t work…exactly. Just thought I’d share some goodness and save someone from pulling their hair out.
@ ryanb - You are adjusting the value after it has been read. you are not adjusting analog input value. Btw the eBlock extension module can provide 3V3 or 5V to power an eBlock, there is a switch on the module.
@ Architect – I know I am adjusting the value after it is read. I do not have an eBlock extension module (cannot find them for sale anyplace). My Panda had a 5 volt signal where-as the Spider is 3.3. Using the original formula, the temperature is DRASTICALLY off unless this correct is applied. (My sensor isn’t defective – it works perfectly well on my Panda still with the original driver. I was not able to obtain readings even close to the Panda on the spider until I applied this software correction)