Hello,
I am experiencing a weird issue with a code which I wrote for my ultrasonic distance measurement sensor for Thingy91. The code works fine and gives measurement values when I build for thingy91_nrf9160 but it doesn't work when I build for thingy91_nrf9160ns and distance measurement always comes out to be 0.
I am linking the datasheet of the sensor as it explains the operating principle of the sensor: https://www.makerguides.com/wp-content/uploads/2019/02/JSN-SR04T-Datasheet.pdf . I am using it in Mode 1.
I can see the sensor LED blinking which means that sensor is being triggered correctly so I think the problem arises when we try to calculate the time for which the sensor response remains high. This is done using GPIOTE events, Timer and Interrupt.
I am attaching the code so can anyone, please, take a look and see what aspects of it might not be working when I build for thingy91_nrf9160ns.
Thank you.