Blueforcer Well-Known Member Licensed User Longtime User Sep 4, 2018 #1 Is there a function similar to the Map function in Arduino for B4J?
Daestrum Expert Licensed User Longtime User Sep 4, 2018 #2 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
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