After some testing, I noticed I made some mistakes. You want to divide angle by 360 divided by how ever many angles you have. In my example, I used 8 since I have 8 angles. Then you round it - you'll get a range from -4 to 4. Range changes depending on how many angles you have. 0 is up, 1 is top right, etc. Note that when it reaches -4, it goes to 4 but it's still pointing in the same direction. It's just that the angle becomes negative when the joystick ball is pointing to the left. Here are screenshots that should help.











