Propeller Math
MD2010
Posts: 11
I am trying to do a simple math calculation and turn LEDs on.
outa[8..15] := 0 will not turn any on
outa[8..15] := 255 will turn all on
My formula is var2 := (var1 - 800)/4.70588.
outa[8..15] := var2
I understand that var1 needs to be a long and Var2 needs to be an int, but I dont know how to do that.
The variable input, var1, will be between 800 and 2000, so the results, var2, will be between 0 and 255.
outa[8..15] := 0 will not turn any on
outa[8..15] := 255 will turn all on
My formula is var2 := (var1 - 800)/4.70588.
outa[8..15] := var2
I understand that var1 needs to be a long and Var2 needs to be an int, but I dont know how to do that.
The variable input, var1, will be between 800 and 2000, so the results, var2, will be between 0 and 255.
Comments