🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Compile but does not work with a for next loop

    Arduino
    2
    3
    2.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      F1CJN_Alain
      last edited by F1CJN_Alain

      My short exemple prints a number on the screen
      But if I include a for next loop , it compiles but does not show the number on the M5 core screen.
      If I uncomment the" for next" line, it does not print on the screen . Why ?

      #include <M5Stack.h>
      #include "M5StackUpdater.h"
      float voltage = 2224.33;

      void setup() {
      M5.begin();
      }
      void loop() {
      //for (int i = 1; i = 10; i++) {}
      M5.Lcd.setTextColor(WHITE, BLUE);
      M5.Lcd.drawString("Voltage = "+String(voltage)+" mV ",30,40,4);
      delay(50);
      }

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        Hello @F1CJN_Alain

        try with for (int i = 1; i <= 10; i++) instead. Eg. i <= 10 instead of i = 10.

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0
        • F
          F1CJN_Alain
          last edited by

          Thanks a lot, Félix. I was concentrated on a big file and did not notice this .
          Regards
          Alain Hamradio F1CJN

          1 Reply Last reply Reply Quote 0
          • First post
            Last post