For some reason my program gets stuck in the while loop that checks if the echo pin is 0, and because it's always 0, it gets stuck there. I tried creating a version of this program in C/C++ too for the Pico, but it still doesn't work. I have tried it with 2 different sensors too, thinking that it might be a component problem, but no luck. I also tried a version of this using an arduino and it works fine. Do you have any idea what might be causing the issue with my pico?
For some reason my program gets stuck in the while loop that checks if the echo pin is 0, and because it's always 0, it gets stuck there. I tried creating a version of this program in C/C++ too for the Pico, but it still doesn't work. I have tried it with 2 different sensors too, thinking that it might be a component problem, but no luck. I also tried a version of this using an arduino and it works fine. Do you have any idea what might be causing the issue with my pico?