Connect the inductor into the oscillating circuit to oscillate (the capacitance in the circuit is known), shape the oscillating wave into a square wave (note that the influence of higher harmonics is eliminated by Schmidt trigger shaping), then measure the time between two rising edges (or falling edges) with ICP interrupt, and the reciprocal of the time is the frequency, and then calculate the inductor according to the frequency and the circuit capacitance value.
If the range to be measured is relatively large, several capacitors can be used for step measurement.
There is no reward for such questions! If you hadn't met me, maybe no one would have answered you.
If you can't do it, you can add me QQ: 40611,and I can do it for you, but there is a charge.