Announcement

Collapse
No announcement yet.

Ip address not displaying correctly on uLCD-43DT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ip address not displaying correctly on uLCD-43DT

    Hi,

    I have a uLCD-43DT running with a Teensy 3.5. The display runs great with all the objects and genie.WriteStr messages. The lone exception is the following:

    ​​​​​​ void printWiFiData() {
    // print your WiFi shield's IP address:
    IPAddress ip = WiFi.localIP();
    Serial.print("IP address : ");
    Serial.println(ip);
    genie.WriteStr (19, ("IP address : ");
    genie.WriteStr (20, (ip));

    On my serial monitor the correct ip address appears:

    ​​​​​​IP address : 192.168.1.104

    On the uLCD-43DT it appears:

    IP address:
    8724631935

    It has happen with the Mega and the Teensy 3.5--for some reason the ip address is corrupted or being displayed incorrectly on the genie display. Any help would be appreciated.
    Thanks

  • #2
    Hello,

    Welcome to the forum,

    This is quite normal as the IP address is not a string. You could add this void to your arduino sketch and it will return the IP address as a string.

    String ipToString(IPAddress ip){
    String s="";
    for (int i=0; i<4; i++)
    s += i ? "." + String(ip[i]) : String(ip[i]);
    return s;
    }

    ipstring = ipToString(ip);

    I hope this helps

    Best regards

    Paul

    Comment


    • #3
      (String)192.168.1.104
      genie.WriteStr (20, ((String)ip));

      Comment


      • #4
        Thanks I'll give it a try tonight.
        rick

        Comment

        Working...
        X