Advertisement
This is comment for paste
Game Controller - Rotary Encoders HSI Course & Heading Knobs
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Figured I'd note here that a first draft used a different method for correcting rotation within 360 degrees,
- * yet I changed it to a more readable form for folks newer to coding and Arduino, so they would better be able
- * to understand the simple logic that is occuring in this snippet. Therefore, it should also be noted that it
- * can be expressed more concisely in a single line using a modulus operator like this:
- */
- //Correct Rotation within 360 deg.
- val = (val % 360 + 360) % 360;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement