ThiagoC
Hello guys,
 
I’m trying to read temperature data from a TMP36GZ sensor using a STM32 Bluepill in OpenPLC. The problem is that I’m getting wrong values when using the default value of 65535. I think this is the standard for the openplc environment, right?
 
To get correct values from the analog input I must use 16384 in the scaling formula. I think this has something to do with this line in stm32_f103cb.cpp.
 
            *int_input[i] = (analogRead(pinMask_AIN[i]) * 16);
 
I suppose that I need to use 16384 because the resolution in the analog input is set to 1023 by default and not 4096. Is there something I'm missing here?
 
Do I have to manually set analogReadResolution(12) in stm32_f103cb.cpp?
 
Thanks!!
Reply 0 0
thiagoralves
>>Do I have to manually set >>analogReadResolution(12) in >>stm32_f103cb.cpp?

Most likely yes
Reply 1 0
Reply