hello,
i’am using the Pololu 3Pi+ 32U4 for my project to drive it with a WiFi module. However, i’m using the Magnetometer as a Compass and i’am following the Pololu turnWithCompass exemple.
it works fine but can anyone explaine to me the next code lines in the Pololu exemple:
This part of the program is just taking the averaged measurements from the magnetometer in the x and y directions (v.x and v.y) and scaling (normalizing) them per the minimum and maximum values from the calibration process (m_min.x, m_min.y, m_max.x, and m_max.y) so that they end up in the range of -1 to 1. You can read more about the formula used for this here: