Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature currently requires accessing the site using the built-in Safari browser.
ivancho said:Problems you might encounter. When using a 5V reference with a 8-bit ADC you have a steps of 0.019V. So 0.019V = 1 and 0.39V =2 and so on. Well say you have a 110 and a 6 as your two numbers. If you wanted to divided 110/6 that will give you 18.33 right.... but since only integer math can be done the result will be 18.
Nigel Goodwin said:You use a similar method programming a PC as well - it's far better to use integer maths where you can.
Exo said:Nigel Goodwin said:You use a similar method programming a PC as well - it's far better to use integer maths where you can.
depends, pc's x87 are faster in calculating complex floating point math then the main ALU is at integers
On a µC, ofcourse, FP should be avoided
ivancho said:The problem with scaling is that while it works well with displaying on LCD, etc it is not so good when sending it to a 8-bit DAC. You are still going to need to send a 0-255 number, and when you scale back down you are doomed again :evil:
If you were to use a 10-bit DAC then you will not have the perfect relation ship between the division result and what you need to output.
Ivancho