MKR 1010 and A02YYUW Waterproof Ultrasonic Sensor

HI it works now. One problem I have is that changes in distance are really really slow… It takes upto 2 minutes for the change to be shown in the program… It would be nice to know any ideas on this but I could possibly use it that way, I want to measure my oil tank. I double checked and read of the serial1 happens every on second.

EDIT: I think I need somehow to clear the UART buffer before reading. Any ideas?