Ingvar,
I tested your code a minute ago; with some additions;
Congratulations! It works flawlessly.
My code is almost the same as yours.
What I see here is that, when we set the pin HIGH and then LOW, the time it takes to set the pins is already good enough for the sensor reading.
Bookmarks