Atom-Lite LED



  • Newbie question - I am trying to run the FastLED Blink example on my Atom-Lite, but I can't seem to get it to work. I changed the DATA_PIN to 27, and tried the NEOPIXEL, the SK6812, and various other options, but couldn't get it to work. The code seems to compile and download fine. I have the board set to "M5Stack-ATOM". Any help would be appreciated!



  • Hello @paulhdietz

    I suggest you try this example. Worked as-is for me - no modifications required.

    Thanks
    Felix



  • Thanks for the suggestion. I did try that. No luck. I added a bunch of Serial.println statements just to verify with Serial Monitor that the program was running. It was running fine, properly switching through the cases, but the LED was not responding. (By the way, it works when I program using Flow, so it doesn't appear to be a hardware issue.)

    I thought maybe I had the wrong board specified in the Arduino environment since the Atom-Matrix and Atom-Lite have very different LED setups. The only choice that seems reasonable is "M5Stack-ATOM", but I see this is defining a bunch of stuff that is specific to the Matrix version. Is there an Arduino board file specifically for the Atom-Lite?

    According to the schematics, the Matrix version and the Lite version use different LED protocols (WS2812C vs SK6812). I just don't see where in the LEDSet sample code I would specify one versus the other.

    One last thought - do I need to put the device in USB mode or something like that? I tried erasing it with M5Burner, but that didn't see to change anything.

    Thanks!

    --- paul



  • Hello @paulhdietz

    Hmm, that is strange. I can flash and run the same code onto both, M5AtomLite and M5AtomMatrix, just fine. On the M5AtomMatrix only the first (of the 25) LEDs is used. So no, I don't think there is a difference between the two regarding LEDs except for the total number of LEDs.

    USB mode is only relevant if your M5AtomLite is running UIFlow firmware.

    At this point in time I don't have any other idea what might be wrong. Sorry.

    Thanks
    Felix



  • Hi Paul,

    I do this on my Atom Lite:

    #include <FastLED.h>
    
    CRGB mainLED;
    
    void setup() {
      M5.begin();
    
      FastLED.addLeds<NEOPIXEL, 27>(&mainLED, 1);
      FastLED.setBrightness(10);
    }
    

    And then in loop to set the color I use:

          mainLED = CRGB::Red;
          FastLED.show();
    

    Hope that is of any help.

    -- Marc



  • The mystery deepens. I opened up the unit to see what LED is actually used.0_1638980198707_Atom-Lite.jpg

    I probed the pin and was surprised to find Vdd on the upper right pin, GND on the lower left, and data on the other two pins. Looking at the datasheets for the WS2812C and the SK6812, GND should be next to the notch on the lower right. It's rotated from the datasheets!

    I also noticed that the board is labeled "Atom V1.3 1720"

    I looked at the data coming from the default firmware lighting the LED, and that looked like what I would expect. But then I looked at the data coming from the Arduino code examples that were not working, I can see them sending data to the LED at the right intervals, but the data rate is much slower - maybe an order of magnitude slower. And it looks like that slow data is not being recognized because I only see it on the one pin - as if Data out is not working.

    My conclusion from this is that somewhere, the data rate is getting messed up on the Neopixel driver. Any thoughts?



  • I think I figured it out. The problem was apparently the version of the board I had loaded in Arduino's Board Manager. I was using The official M5Stack 2.0.0 board file. This does NOT work. It has sending the LED data at effectively the wrong baud rate. Reverting to 1.0.9 solved the problem. How do I let the good people at M5Stack know they have this bug to fix?