-
-
Save sdrshnptl/f7889ebc5f7e2a19d1ed6cc5a813822c to your computer and use it in GitHub Desktop.
ARDUINO: MAP FLOAT FUNCTION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double mapf(double val, double in_min, double in_max, double out_min, double out_max) { | |
return (val - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment