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

    M5Atom Matrix, M5Unfied, controlling leds

    Scheduled Pinned Locked Moved Atom
    3 Posts 2 Posters 1.0k 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.
    • H Offline
      HappyUser
      last edited by

      Hi am stumped,
      I just can't control the leds anymore.
      This is my code, no led goes on.
      Any suggestion where I am going terrible wrong?

      #include <arduino.h>
       #include <M5Unified.h>
       #include <FastLED.h>
       #define NUM_LEDS 25
      #define DATA_PIN 27
      #define CLOCK_PIN 13
      CRGB leds[NUM_LEDS];
      
      void setup() {
      auto cfg = M5.config();
      cfg.serial_baudrate = 115200;
      cfg.output_power = true;
      M5.begin(cfg);
          //FastLED.addLeds<WS2812, DATA_PIN,GRB>(leds, NUM_LEDS);  // GRB ordering is assumed
          FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS); 
      
          for (int i=0;i<NUM_LEDS;i++) {leds[i]=CRGB::Red;};FastLED.show();
      
      
      }
      
      felmueF 1 Reply Last reply Reply Quote 0
      • felmueF Offline
        felmue @HappyUser
        last edited by felmue

        Hello @HappyUser

        M5Unified has built-in LED support. My guess is that the two, M5Unified and FastLED, are 'fighting' for the LED. Have a look here. There is an example at the end of the page.

        Thanks
        Felix

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

        H 1 Reply Last reply Reply Quote 0
        • H Offline
          HappyUser @felmue
          last edited by

          @felmue thanks. Indeed. Leaving out m5unified does the trick. Though I haven’t read anything about an incompatibility between M5Unified and FastLed. Regards.

          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