I am new to PICBasic and having an issue with the following portion of my code:
MAXVAL VAR Word
DIST VAR Word
MAXVAL = 32
DIST = 1 to 30
Percent=(DIST/MAXVAL)*100
The Precent value is always zero!
I suspect the "Percent" variable contains a non whole number and that is why it has no value.
Is there a way I can present this equation differently to round up or down to the nearest whole number?
I appreciate any advise.
Thank you.
Bookmarks