Using integer math
1023 / 213 = 4 remainder 171
remainder 171*100 / 213 = 80
So, adcVal1 = adcVal / 213
adcVal2 = ((adcVal // 213)*100)/213
Then print the value
This is the quick and easy way. Others might suggest more optimal techniques using PBP
Using integer math
1023 / 213 = 4 remainder 171
remainder 171*100 / 213 = 80
So, adcVal1 = adcVal / 213
adcVal2 = ((adcVal // 213)*100)/213
Then print the value
This is the quick and easy way. Others might suggest more optimal techniques using PBP
maybe like this
100/213 *256 = 120
using the */ operator
1023 */ 120 = 479
so
adcVal1 = adcVal */120
lcdout $fe, $C0, dec adcval1/100 ".",dec1 adcVal1//100
Bookmarks