user40578: I'm trying to make an RC controller.
I have a problem with my LCD.

I have already double-checked the wiring and the connections are great.
I made a PCB with Kicad and order it to JLCPCB. I have some mistake, you can see the soldered wire.


Before the PCB, I did my project with a breadboard and it worked fine.
const String menuElem[4] = {"Models", "Trims", "Reverse command", "Channel"};

const int rs = 3, en = 4, d4 = 5, d5 = 6, d6 = 7, d7 = 8;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void menu() {
  lcd.clear();
  //lcd.setCursor(0,0);
  //byte pos = 0;
  //int sizeOfanArray = *(&array + 1) - array;
  byte menuElemLength = *(&menuElem + 1) - menuElem;
  for (byte i = 0; i < menuElemLength; i++) {
    lcd.setCursor(2, i);
    lcd.println(menuElem[i]);
  }
  showMenuNav(currentMenuPos);
}


user2967: Your code to calculate the length of your Strings does not make sense. The String type is an object type. The addresses of your String objects will not match the length of the charcters in those strings. You should use an array of C strings as suggested by Juraj, and then you should use strlen() to get the length of those strings (C strings have a null terminating byte, and strlen() uses that null to calculate the length. Note that C strings can't handle Unicode.)
The String type is best avoided on Arduino anyway, as String objects tend to fragment the extremely limited heap memory on Arduino devices and cause out-of-memory crashes.

40578: <p>I'm trying to make an RC controller.</p>
<p>I have a problem with my LCD.</p>
<p><a href="https://i.stack.imgur.com/CUKhu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CUKhu.jpg" alt="Lcd with japanese and indescribable char like" /></a></p>
<p>I have already double-checked the wiring and the connections are great.</p>
<p>I made a PCB with Kicad and order it to JLCPCB. I have some mistake, you can see the soldered wire.</p>
<p><a href="https://i.stack.imgur.com/5RAHg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5RAHg.jpg" alt="PCB designed with kicad and made by JLCPCB" /></a></p>
<p><a href="https://i.stack.imgur.com/RhCZQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RhCZQ.png" alt="Schema Kicad" /></a></p>
<p>Before the PCB, I did my project with a breadboard and it worked fine.</p>
<pre class="lang-cpp prettyprint-override"><code>const String menuElem[4] = {&quot;Models&quot;, &quot;Trims&quot;, &quot;Reverse command&quot;, &quot;Channel&quot;};

const int rs = 3, en = 4, d4 = 5, d5 = 6, d6 = 7, d7 = 8;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void menu() {
  lcd.clear();
  //lcd.setCursor(0,0);
  //byte pos = 0;
  //int sizeOfanArray = *(&amp;array + 1) - array;
  byte menuElemLength = *(&amp;menuElem + 1) - menuElem;
  for (byte i = 0; i &lt; menuElemLength; i++) {
    lcd.setCursor(2, i);
    lcd.println(menuElem[i]);
  }
  showMenuNav(currentMenuPos);
}
</code></pre>
 2967: <p>Your code to calculate the length of your <code>String</code>s does not make sense. The <code>String</code> type is an object type. The addresses of your String objects will not match the length of the charcters in those strings. You should use an array of C strings as suggested by Juraj, and then you should use <code>strlen()</code> to get the length of those strings (C strings have a null terminating byte, and <code>strlen()</code> uses that null to calculate the length. Note that C strings can't handle Unicode.)</p>
<p>The String type is best avoided on Arduino anyway, as String objects tend to fragment the extremely limited heap memory on Arduino devices and cause out-of-memory crashes.</p>
