🤖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

    Atom
    2
    2
    24
    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
      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
        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

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