B4J Question Arduino Map equivalent function

Daestrum

Expert
Licensed User
Longtime User
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
 
Upvote 0
Top