I’ve been working on a control that behaves like an encoder wheel that is turned with the mouse and outputs the current angle of rotation.
I’m having trouble figuring out how to get it to output 0 through 360 but forcing 360 to output 0.
When I try to use the output value, it gets messed up in the small space where 359 changes to 360, and then to 0. Using a map().
I want a float value in the range of 0-360 excluding 360. Is there a way to do that?
The code I have is really long including the encoder class and all the mouse testing etc. and it’s a bit of a mess so I’m not including it, hoping someone would know how to solve the problem conceptually.
Thank you, I did try using %360, but it didn’t work. I probably have to clean up my mess and try it again. I can see how it does actually work here in your example