Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
The problem for me was in the programming. You need to use floating point numbers to make the accuracy "1 degree" or/and connect more than 1 LM335 like its written in the datasheet.
You don't "need" floating point. An ADC running at 5V will have each count representing 5mV. This means you can read with a resolution of approx 0.5C. No amount of manipulation with floating point will change this. If you wan't to keep the 0.5C part and still use signed integers then subtract 273*2 before using itoa and placing the decimal in the correct position.
Mike.
Even at "10mv/degree" I had a bad accuracy until I increased the formula numbers to x.xxxxxx.You don't "need" floating point. An ADC running at 5V will have each count representing 5mV. This means you can read with a resolution of approx 0.5C. No amount of manipulation with floating point will change this. If you wan't to keep the 0.5C part and still use signed integers then subtract 273*2 before using itoa and placing the decimal in the correct position.
Mike.
Even at "10mv/degree" I had a bad accuracy until I increased the formula numbers to x.xxxxxx.
I know, but it doesn't work. And on todays MCUs it does not matters too. I am thinkig we wont get along.In which case you weren't doing it right - it's a LOT faster, more accurate, and uses much less memory, to use integer maths rather than floating point.
You just need to be aware of exactly what you're doing, and simply add the decimal point in the string at the end - if you were getting inaccuracies (and they would be substantial ones) you were getting results outside the range of your integer variables somewhere during the maths.
But, it does work. You get an integer value from the ADC which you can manipulate to get the ascii string you want to print. And, why doesn't it matter? I guess You just get a bigger faster processor rather than a much cheaper solution if you adjust your attitude.I know, but it doesn't work. And on todays MCUs it does not matters too.
I know, but it doesn't work. And on todays MCUs it does not matters too. I am thinkig we wont get along.
I mean on the 4MHz PIC16F690 that I have tried, it makes no difference in the performance, I know it should work without the floating points, but it doesn't.