Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. Stoni99
    S
    • Continue chat with Stoni99
    • Start new chat with Stoni99
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    Stoni99

    @Stoni99

    0
    Reputation
    17
    Posts
    155
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Stoni99 Follow

    Posts made by Stoni99

    • RE: I am looking for internet time M5Stack for Arduino ide

      Ahhh - ok: "//waitForSync();" 👍

      posted in Arduino
      S
      Stoni99
    • RE: I am looking for internet time M5Stack for Arduino ide

      ezTime.h works now. I have updated to new Version. Thx!

      posted in Arduino
      S
      Stoni99
    • RE: I am looking for internet time M5Stack for Arduino ide

      ezTime.h seems easier to condition?!🤔

      posted in Arduino
      S
      Stoni99
    • RE: I am looking for internet time M5Stack for Arduino ide

      @macsbug said in I am looking for internet time M5Stack for Arduino ide:

      Hell@Stoni99

      I'm using the World Time API.
      It is good to use it according to the area.

      World Time API : http://worldtimeapi.org/

      Example
      ......

      Code works - thanks!

      posted in Arduino
      S
      Stoni99
    • RE: I am looking for internet time M5Stack for Arduino ide

      @felmue said in I am looking for internet time M5Stack for Arduino ide:

      Hello @Stoni99

      your code runs fine on my M5Stack.

      • what happens if you comment out waitForSync()?
      • what is the log output of the crash?

      Thanks
      Felix

      What do you mean by comment out?
      I don't have log output , it just restarts.

      posted in Arduino
      S
      Stoni99
    • RE: I am looking for internet time M5Stack for Arduino ide

      I tried example codes. After establishing the Internet connection, the M5Stack crashes and restarts. He doesn't seem to tolerate waitForSync();

      #include <M5Stack.h>
      #include "WiFi.h"
      #include "ezTime.h"

      const char *ssid = "xxxxxxxxxxx";
      const char *password = "xxxxxxxxxxx";

      void setup(){
      //Serial.begin(115200);
      M5.begin();
      M5.Power.begin();
      WiFi.mode(WIFI_STA);
      WiFi.disconnect();
      delay(100);
      WiFi.begin(ssid, password);
      M5.Lcd.print("Call to " + String(ssid));
      while (WiFi.status() != WL_CONNECTED) {
      M5.Lcd.print('.');
      delay(1000);
      }
      M5.Lcd.println(" ");
      M5.Lcd.println(WiFi.localIP());
      M5.Lcd.print("Signalstearke: ");
      M5.Lcd.println(WiFi.RSSI());
      //server.begin();
      delay(2000);
      M5.Lcd.clear();

      waitForSync();
      M5.Lcd.println();
      M5.Lcd.println("Time in various internet standard formats ...");
      M5.Lcd.println();
      M5.Lcd.println("ATOM: " + dateTime(ATOM));
      M5.Lcd.println("COOKIE: " + dateTime(COOKIE));
      M5.Lcd.println("IS8601: " + dateTime(ISO8601));
      M5.Lcd.println("RFC822: " + dateTime(RFC822));
      M5.Lcd.println("RFC850: " + dateTime(RFC850));
      M5.Lcd.println("RFC1036: " + dateTime(RFC1036));
      M5.Lcd.println("RFC1123: " + dateTime(RFC1123));
      M5.Lcd.println("RFC2822: " + dateTime(RFC2822));
      M5.Lcd.println("RFC3339: " + dateTime(RFC3339));
      M5.Lcd.println("RFC3339_EXT: " + dateTime(RFC3339_EXT));
      M5.Lcd.println("RSS: " + dateTime(RSS));
      M5.Lcd.println("W3C: " + dateTime(W3C));
      M5.Lcd.println();
      M5.Lcd.println(" ... and any other format, like "" + dateTime("l ~t~h~e jS ~o~f F Y, g:i A") + """);
      delay(6000);
      }

      void loop() {
      events();
      }

      posted in Arduino
      S
      Stoni99
    • I am looking for internet time M5Stack for Arduino ide

      Unfortunately, ezTime.h does not work on the M5Stack.

      Does anyone know of a simple, working way to get the time and date from the internet?

      posted in Arduino
      S
      Stoni99
    • RE: M5. Lcd.textWidth does not center text exactly in the middle

      👍Thank you!

      posted in Arduino
      S
      Stoni99
    • RE: M5. Lcd.textWidth does not center text exactly in the middle

      OK - thank you!
      The height is therefore adjusted by hand.

      Other question:
      I can't append the "W" to the string. It is not displayed. Is there another possibility?

      for (int i=-1500; i <= 2255; i++){
      String text = String(i)+"W";
      M5.Lcd.fillRoundRect(30, 60, 260, 120, 15, BLACK);
      M5.Lcd.drawCentreString(text, M5.Lcd.width()/2, M5.Lcd.height()/2-30 , 7); //Text auf x zentrieren (x,y,Schriftgrösse)
      //M5.Lcd.drawString(text, (int)((M5.Lcd.width()/2)-(M5.Lcd.textWidth(text)/2)-15), (int)((M5.Lcd.height()/2)-40), 2);
      delay(1000);
      }

      posted in Arduino
      S
      Stoni99
    • M5. Lcd.textWidth does not center text exactly in the middle

      I want to write a text centered in the middle. the text has a variable size. with M5. Lcd.textWidth, the text is not centered exactly in the middle (deviation about 5px). I doing something wrong? How can I center the text in height?

      void loop() {
      M5.Lcd.fillScreen(BLACK); //set the default background color
      M5.Lcd.fillRoundRect(20, 50, 280, 140, 15, RED);
      M5.Lcd.fillRoundRect(30, 60, 260, 120, 15, BLACK);
      M5.Lcd.setTextSize(5);
      M5.Lcd.setTextColor(RED);
      for (int i=-1500; i <= 2255; i++){
      String text = String(i);
      M5.Lcd.fillRoundRect(30, 60, 260, 120, 15, BLACK);
      M5.Lcd.drawString(text, (int)((M5.Lcd.width()/2)-(M5.Lcd.textWidth(text)/2)), (int)(M5.Lcd.height()/2), 2);
      delay(20);
      }
      }

      posted in Arduino
      S
      Stoni99