By using a 3 dof magnetometer and a magnet, the angle of a rotating object can be determined. This Arduino program must first be given data measured at constant rotation speed to be able to compensate correctly for magnet misalignment and more. Designed for Arduino Nano 33 BLE (measuring motor position)
Youtube video: https://www.youtube.com/shorts/i_NRryUeHN4