Advertisement
SemlerPDX
Apr 11th, 2023
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Figured I'd note here that a first draft used a different method for correcting rotation within 360 degrees,
  2.  * yet I changed it to a more readable form for folks newer to coding and Arduino, so they would better be able
  3.  * to understand the simple logic that is occuring in this snippet.  Therefore, it should also be noted that it
  4.  * can be expressed more concisely in a single line using a modulus operator like this:
  5. */
  6.  
  7.   //Correct Rotation within 360 deg.
  8.   val = (val % 360 + 360) % 360;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement