🤖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

    Scheduled Pinned Locked Moved General
    3 Posts 2 Posters 5.1k Views
    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 Offline
      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 Offline
        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 Offline
          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

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post