hi
im playing doing some calculations with picaxe 08M.i wanted to calculate the duty cycle using the formula D=1-(Vi/Vo).i did
Symbol vInAdc = b0
Symbol Vi = b1
Symbol Vo = b4
Symbol duty = b2
Symbol difference = b3
Vo= 227 ' 12.0V
Vi = vInAdc
difference = Vi*100/Vo
duty =1-difference
pwmout 2, 99 , duty
my problem is: taking for example Vin=3.5V ,gives duty=70.833%
how do we convert this value in a number cunderstable by picaxe which correspond to the same value??
im playing doing some calculations with picaxe 08M.i wanted to calculate the duty cycle using the formula D=1-(Vi/Vo).i did
Symbol vInAdc = b0
Symbol Vi = b1
Symbol Vo = b4
Symbol duty = b2
Symbol difference = b3
Vo= 227 ' 12.0V
Vi = vInAdc
difference = Vi*100/Vo
duty =1-difference
pwmout 2, 99 , duty
my problem is: taking for example Vin=3.5V ,gives duty=70.833%
how do we convert this value in a number cunderstable by picaxe which correspond to the same value??