PIC Maths. trying to calculate %

ErnieM

Joined Apr 24, 2011
8,415
Now there you go using fencepost math and applying it to the bread loaf domain. ;-)

I pray you did not take my "higher math" comment as something against your posts. Your work is solid and you taught me something here. It was strictly means toward those posters who are whistling in the dark.
 

THE_RB

Joined Feb 11, 2008
5,438
So if I have a load of bread that is one foot long and I want to divide it into 2 intervals, you are saying I divide it by 1. So now I have two pieces of bread that are each 1 foot long? Sounds somewhat biblical. ;-P

It's the classic fencepost problem: The correct number to use depends on whether you want to know how many sections or how many posts.
It's not a fencepost problem or a probability math problem, it's a very simple scaling (ratio math) problem.

If the input data is analogue and goes from 0v-5v and your output data is displayed on a 1v full-scale meter, your scaling is 5:1. There is no correct 4:1 answer.

The *number* of steps that the input data set is divided into has no consequence, the important issue is the ratio of data in to data out, which to get a correct linear percentage from a PIC ADC is *100 /1024.
 

WBahn

Joined Mar 31, 2012
32,929
Now there you go using fencepost math and applying it to the bread loaf domain. ;-)

I pray you did not take my "higher math" comment as something against your posts. Your work is solid and you taught me something here. It was strictly means toward those posters who are whistling in the dark.
Oh, heavens no. Similarly, I hope you recognized my quip as being purely in jest. Tone of voice just doesn't carry itself well in the written word, so it's hard to tell jest from joust.
 

ErnieM

Joined Apr 24, 2011
8,415
Oh, heavens no. Similarly, I hope you recognized my quip as being purely in jest. Tone of voice just doesn't carry itself well in the written word, so it's hard to tell jest from joust.
I saw your post as being in jest, I just wanted to make sure you saw mine the same way.

Happy trails to you!
 
Top