Hi,

I have a word variable that can hold a number from 0 to 4096. I want to display the value of that variable as a percentage on an LCD. EG when it's 4096 it's 100%, when 2048 it's 50% etc. but can't think how to do it. I know that simply dividing 4096 by 100 will give me the increment value for 1%, but can't seem to format it to work correctly. From a previous bit of code I came across this which is used in a menu option to set the value of CH1_Max between 0 and 4096 by using a word variable which has a value between 0 and 100

Code:
CH1_Max = maxbright */ 10484
Any pointers ?