Hello Martin,
Thx yes now can be compiled and value can be read from sensor but ,
I saw a strange problem when make a string calculation before to send the string to UART.
That calculation result is wrong even if in simulation the result is good.
Code: Select all
SerialString = "/*Sensor," + SAlt + "," + Spressure + "," + STemp + "*/"
simulation result
- string from UART console in debug mode.jpg (10.2 KiB) Viewed 3709 times
But When send the String SerialString to device from UART, there is always only 22 characters sent
I did different test with different begining of the String to see how it affect the calculation as you can see there is always 22 characters
/*BarometricSensor,9*/ is 22 characters
/*Sensor,982.88,977.*/ is 22 characters
/*B,976.7,1009.58,20*/ is 22 characters
as you can see, the 2 end characters "*/" are present but the middle is missing
Then I did a test without the 2 last characters
Code: Select all
SerialString = "/*Sensor," + SAlt + "," + Spressure + "," + STemp
result is 25 characters : /*Sensor,983.73,977.20.93
then Changed the beginning of the string "sensor" by "BarometricSensor" to increase the string length
result is 25 characters : /*BarometricSensor,920.74
- console1.jpg (41.01 KiB) Viewed 3709 times
The string is always incomplete and If the string is without "*/" at the end, the length is 25 if with "*/" the length is 22 characters
I did a test with a different way of the string calculation
Code: Select all
SerialString = "/*Sensor,"
SerialString = SerialString + SAlt
SerialString = SerialString + ","
SerialString = SerialString + Spressure
SerialString = SerialString + ","
SerialString = SerialString + STemp
SerialString = SerialString + "*/"
With this way, the string is complete: /*Sensor,984.57,977.68,20.83*/
Even is the beginning of the string is longer
10:08:57.205 -> /*BarometricSensor,982.32,977.74,20.84*/
Could you check what is the problem please . May be there is a link with TMP String Size.
thx