Skip to content

Instantly share code, notes, and snippets.

@DarkCat09
Created March 29, 2021 03:33
Show Gist options
  • Save DarkCat09/7ce5c5ae4260c435993e0a93a9474b88 to your computer and use it in GitHub Desktop.
Save DarkCat09/7ce5c5ae4260c435993e0a93a9474b88 to your computer and use it in GitHub Desktop.
Wiring C++ function map()
// https://www.arduino.cc/reference/en/language/functions/math/map/
return (x - 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