I'm on B4A v3.0 and developing an interface for a temperature controller project. I have it all working but have one problem. In the attached picture you can see that the fermentation temperature is 75.5F but the Fermentation dial reads 75.0F. I can't get the dial to read 75.5F. My code seems to round off to an integer even though my math is all floating.
Where am I going wrong? Anyone? Please.
Here is my code: ***************************************************
Sub setTemp(Temp As Float)
Select strDialPick
Case "Ambient"
Angle = (150 + (Temp * 3)) Mod 360
Rotation.InitializeRotateCenter("Animation", Angle, Angle, pnlAmbientNeedle)
Rotation.Duration = 20000
Rotation.Start(pnlAmbientNeedle)
Case "BrewBox"
Angle = (150 + (Temp * 3)) Mod 360
Rotation.InitializeRotateCenter("Animation", Angle, Angle, pnlBrewBoxNeedle)
Rotation.Duration = 20000
Rotation.Start(pnlBrewBoxNeedle)
Case "Ferment"
Angle = (30 + (Temp * 6)) Mod 360
Rotation.InitializeRotateCenter("Animation", Angle, Angle, pnlFermentNeedle)
Rotation.Duration = 20000
Rotation.Start(pnlFermentNeedle)
End Select
End Sub
End Code here *********************************************************
Where am I going wrong? Anyone? Please.
Here is my code: ***************************************************
Sub setTemp(Temp As Float)
Select strDialPick
Case "Ambient"
Angle = (150 + (Temp * 3)) Mod 360
Rotation.InitializeRotateCenter("Animation", Angle, Angle, pnlAmbientNeedle)
Rotation.Duration = 20000
Rotation.Start(pnlAmbientNeedle)
Case "BrewBox"
Angle = (150 + (Temp * 3)) Mod 360
Rotation.InitializeRotateCenter("Animation", Angle, Angle, pnlBrewBoxNeedle)
Rotation.Duration = 20000
Rotation.Start(pnlBrewBoxNeedle)
Case "Ferment"
Angle = (30 + (Temp * 6)) Mod 360
Rotation.InitializeRotateCenter("Animation", Angle, Angle, pnlFermentNeedle)
Rotation.Duration = 20000
Rotation.Start(pnlFermentNeedle)
End Select
End Sub
End Code here *********************************************************