Hi there. If I have 3 word variables, each containing an ADC value, how do I translate the following mathematical equation from Excel into Picaxe language? I want the final figure to appear correctly on my Serial OLED (LCD) as a whole number with a percentage sign after it; no decimals. e.g. 64%
Example:
=SUM(ADC1-ADC2)/ADC3*100
=SUM(801-750)/80*100
or a broken down version...
=SUM(801-750)
=51
=51/80
=0.6375
=0.6375*100
=63.75
=64
It's probably really simple. I've had a go, but had no luck; Forgot what code it was now Appreciate any assistance. Thanks!
Example:
- ADC1 = 801
- ADC2 = 750
- ADC3 = 80
=SUM(ADC1-ADC2)/ADC3*100
=SUM(801-750)/80*100
or a broken down version...
=SUM(801-750)
=51
=51/80
=0.6375
=0.6375*100
=63.75
=64
It's probably really simple. I've had a go, but had no luck; Forgot what code it was now Appreciate any assistance. Thanks!