12-10-2016, 07:21
Hi Jim
Thank you for getting back to me, sorry to see that it was not a smooth transition to the code example I provided. I use km/h as my wind unit of measure and have not tested it under any other option.
I will start with the pressure. I think this will be resolved once we get the wind line right. Any text overflow flow from the line above, will spill onto the next line. For example, the screen you are using is a 20 character by 4 lines. If you try to print 21 characters to the LCD screen, the 21st character will flow onto the next line. Therefore with 2 letters missing on the "Pressure" line, I think this is 2 characters of overflow from the wind line above it.
Also I notice that there is not a space between the text "Wind" and the colon which makes me wonder a little bit about the formatting of the code.
Jim, could you do me a favour? I know it is not your desired unit of measure, but could you change in your settings to display km/h as a wind unit of measure under "Config_RX" and see if this changes the display to like mine?
I have resubmitted just the wind code below. One thing I have changed is added an extra space at the end of the "m/s" and "Kts" as these only use 3 characters of text where as km/h uses 4 (to keep the line formatting the same). I have also added some additional notes in line to try and help.
I have attached two example photos to show how the colons, km/h and wind direction always stays in the same place as different wind speeds come through. Notice how the decimal point also changes as the wind speed drops below/above the preset 9.99 (I have not factored in if I get a wind gust greater than 100, I think I will have other things to worry about if that happens).
I hope this helps
Thank you for getting back to me, sorry to see that it was not a smooth transition to the code example I provided. I use km/h as my wind unit of measure and have not tested it under any other option.
I will start with the pressure. I think this will be resolved once we get the wind line right. Any text overflow flow from the line above, will spill onto the next line. For example, the screen you are using is a 20 character by 4 lines. If you try to print 21 characters to the LCD screen, the 21st character will flow onto the next line. Therefore with 2 letters missing on the "Pressure" line, I think this is 2 characters of overflow from the wind line above it.
Also I notice that there is not a space between the text "Wind" and the colon which makes me wonder a little bit about the formatting of the code.
Jim, could you do me a favour? I know it is not your desired unit of measure, but could you change in your settings to display km/h as a wind unit of measure under "Config_RX" and see if this changes the display to like mine?
I have resubmitted just the wind code below. One thing I have changed is added an extra space at the end of the "m/s" and "Kts" as these only use 3 characters of text where as km/h uses 4 (to keep the line formatting the same). I have also added some additional notes in line to try and help.
Code:
lcd.setCursor(0,3); // Set cursor to line 3, position zero
lcd.print(F(" ")); //print 20 characters of white text
lcd.setCursor(0,2); // Set cursor to line 2, position zero
lcd.print(F(" ")); //print 20 characters of white text
lcd.setCursor(0,2); // Go back to line 2, position zero
lcd.print(F("Wind :")); // Start writing wind info by printing "Wind :"
if (Output_WGust >0.72 ) // If the wind gust value is greater than 0.72, then we want to print this on the LCD screen (else we will print calm later on).
{
if (Output_WGust <= 9.99){lcd.print(Output_WGust, 2); } // Print the numerical value. IF it is below 9.99, display the wind value with TWO decimal points.
else{lcd.print(Output_WGust, 1);} // ELSE the wind speed must be greater than 9.99, therefore we only want to have ONE decimal point (this keeps the formatting standard again and all the text in a line.
#if Wind_Display_Unit == 0 // If the unit of km/h has been chosen, print this unit of measure with 1 space before, and 2 spaces after the text
lcd.print(F(" km/h "));
#endif
#if Wind_Display_Unit == 2 // If the unit of m/s has been chosen, print this unit of measure with 1 space before, and 3 spaces after the text
lcd.print(F(" m/s "));
#endif
#if Wind_Display_Unit == 3 // If the unit of Kts has been chosen, print this unit of measure with 1 space before, and 3 spaces after the text
lcd.print(F(" Kts "));
#endif
lcd.print(vaneDirectionsText[(Unit[WIND_OutUnit].Wind_dir % 3600) / 225]); // Finally print the wind direction text
}
else {lcd.print(F("Calm ")); //This is where we print the "Calm" value if the wind speed is below the predetermined 0.72. Note the white space that follows, this makes up 11 characters including the letters so that the wind direction will print in the same position as if there were wind blowing.
lcd.print(vaneDirectionsText[(Unit[WIND_OutUnit].Wind_dir % 3600) / 225]);} // Some people will probably find this pointless, but I have added the wind direction value again so that it displays next to the "calm" text; although it is calm, I still find it interesting to know where the wind was coming from.I have attached two example photos to show how the colons, km/h and wind direction always stays in the same place as different wind speeds come through. Notice how the decimal point also changes as the wind speed drops below/above the preset 9.99 (I have not factored in if I get a wind gust greater than 100, I think I will have other things to worry about if that happens).
I hope this helps

