/* Convert a degree heading into a sector */
uint16_t degreeToSector(uint16_t degree)
{
- return ((degree * sectors + 180) / 360) % 32;
+ return ((degree * sectors + 180) / 360) % sectors;
}
/* Return the # of sectors clockwise along the compass from start to end. */