Greetings!, recently i got a new project from my office to monitor the weather. But first i want to try the sensors individually. So here's the thing, I want to display the data that written in the code, but in the serial monitor it displays
and the connection of my sensor to arduino uno (from cybertice)
The connections may be ok, but the code does not look good. Did you copy it or write it? I guess from the lack of indentation that you are a complete beginner with code and you copied it.
Please post links to where you find this code and the data sheet for the sensor.
The serial handling in your Calculate routine is flawed. I can see where you got it from as it's basically the same poor code that all the web sites showing how to use those NPK soil sensors use along with their canned modbus messages.
The main issue with the serial handling is that it just assumes that the remote sensor has instantly responded and blindly reads the expected number of bytes in the response message without checking if the sensor has actually responded.
Does your wind direction sensor only give out those 8 fixed angles? If it does not, then you will need to test for a range of values instead.
EDIT: I see from your link below, that the author probably used the NPK code as their starting point. If you are only reading 1 parameter, then the code you are using should appear to work and you will likely be unaware of the flaw in the serial handling.
You should contact cybertice and ask them for help. I do not believe the code they have posted will work correctly, and your experience confirms that. Cybertice need to know that they have published code that does not work so that they can correct it.