UART communication code is not working

Ahoj,

it is not necessary to split your code into 2-3 posts, you can edit already existing post.
Be so kind and use the following procedure to format the code

```
//your code here

```

Also you must provide more information about your project and its issue.
“The sensor” tell us nothing and information about a version of MbedOs (probably not 6+) or tool what you use, is missing.

Anyway, I recommend firstly try the communication of your uart4 with a TTL convertor (or something similar) and a serial terminal app, without the sensor. By this way you can check if your uart4 works and and its output is in correct format.
Then you can connect sensor and try it again.

BR, Jan