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

    Simple Hello World with PlatformIO and M5Dial

    General
    2
    3
    2.6k
    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.
    • U
      uberdweeb
      last edited by

      I am just getting started with M5Dial. I have some programs working in Arduino studio program but Visual Studio Code and PlatformIO seems way better.

      Here is where I am stuck:
      I have the platformio.ini file like this:

      [env:m5stack-cores3]
      platform = espressif32
      board = m5stack-cores3
      framework = arduino

      lib_deps =
      m5stack/M5Dial
      m5stack/M5GFX
      m5stack/M5Unified

      upload_speed = 115200
      monitor_speed = 115200

      and my main.cpp program is simply:

      #include <Arduino.h>

      #include "M5Dial.h"
      #include <WiFi.h>
      #include <M5GFX.h>

      void setup() {
      // put your setup code here, to run once:
      auto cfg = M5.config();
      M5Dial.begin(cfg, true, true);
      M5Dial.Display.setBrightness(34);
      M5Dial.Display.fillScreen(0xABE1);
      M5Dial.Display.setTextDatum(4);
      Serial.print("Test");
      }

      void loop() {
      // put your main code here, to run repeatedly:
      }

      Everything compiles and uploads but screen is blank. Serial monitor equivalent complains about a lot.

      Did I choose the wrong board?
      board = m5stack-cores3

      1 Reply Last reply Reply Quote 0
      • U
        uberdweeb
        last edited by

        After I wrote all of this I figured out I did have the wrong board specified:
        board = m5stack-stamps3
        seems to be correct.

        Now I can't get USBSerial functions to work, and previously any Serial.print statements didn't work but I am one step further!

        Matej's WorkshopM 1 Reply Last reply Reply Quote 0
        • Matej's WorkshopM
          Matej's Workshop @uberdweeb
          last edited by

          @uberdweeb Hello! Sorry for late answer, but I have the fix for it. All you need to do is modify the platformio.ini file, and write this into it:

          [env:m5stack-stamps3]
          platform = espressif32
          board = m5stack-stamps3
          framework = arduino
          build_flags =
             -DARDUINO_USB_CDC_ON_BOOT=1
          monitor_speed = 115200
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post