The bottom of the page you linked explained how it worked
B4X:
Sub ArduinoMap(x As Int, in_min As Int, in_max As Int, out_min As Long, out_max As Long) As Long
Return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.