I am currently building a robot, and i decided to put a compass in it. I want to get the robot to take a reading then subtract or add 90 degrees and turn to that heading.
My problem is what if the heading it takes is 350 degrees. It will then add 90 and get 440. which doesn't work.
I have not made a code for this yet as i want to work this out first.
Thanks
JBoy_529
Yes, unfortunately because the % operator is not a modular-arithmetic operator for negative values (a hangover from the early days of C compilers) I would recommend coding things this way: