2025-10-22 3:58 AM
Hi,
I am working on a project to read the magnetic field with the IIS2MDCTR chip. Actually, I am replacing a read switch with this accelerometer. I use the IIS2MDCSensor Arduino library. After testing with the magnet, I set the threshold to 10000. Enabled the interrupt on all axes in pulsed mode and routed it to the INT pin to get my microcontroller. (STM32U385VGT6) interrupted. When I close the magnet from the z-direction, I get the interrupt. But when I bring it closure from an angle, it does not change the pin status. I tried printing the ODR register values. I saw one, two, or three register values go beyond the 10000 threshold. But I do not get the interrupt. But when I move from the z direction, I am getting the interrupt even when only one axis exceeds the threshold.
Can somebody explain the situation and advise me to understand this behaviour?