First: use code tags for your code parts, else the tag parsing on the server may omit some code.

Quote

The problem is that I get wrong distances as result.

May I guess: your result is about 10-15cm wrong?The transmission of the range command takes approximately 300us which translates to about 10cm. If there's another delay in the communication that I've missed it may be more. The datasheet explicitly states that you are responsible for the synchronization of the two sensors if used this way.

"use code tags for your code parts, else the tag parsing on the server may omit some code."-> Ok next time i will use it.

"May I guess: your result is about 10-15cm wrong?The transmission of the range command takes approximately 300us which translates to about 10cm. If there's another delay in the communication that I've missed it may be more. The datasheet explicitly states that you are responsible for the synchronization of the two sensors if used this way."

-> Ok thanks. I will check if the result is constant wrong. (for example every time about 10cm) Then i will reduce every time the result about 10cm. So i guess i get the right result.