You are reading a single comment by @moka and its replies. Click here to read the full conversation.
  • Trying to connect single individual WS2812B, and control using this code:

    SPI2.setup({
      baud: 3200000,
      mosi: B15
    });
    
    var rgb = new Uint8Array(3);
    
    setInterval(function() {
      // get milliseconds
      var ms = Math.floor(getTime() * 1000);
      // make 0..255 value based on time
      var r = Math.floor((Math.sin(ms / 1000) / 2 + 0.5) * 255);
      // send data
      SPI2.send4bit([ r, 0, 0 ], 0b0001, 0b0011);
    }, 1000 / 60);
    

    So it suppose to fade one color from 0 to 255, from dark to bright.
    But what it does it kinda starts from blue (0-16) and then starts blinking and shifts to red and blinking there as well.
    So looks like something wrong with bits, is it baud rate, or is it different format of data?

    Any assist would be great.
    Wiring is simple, B15 goes to data, power to power, and ground to ground. Nothing more or less.
    Is capacitor here essential, or it is not related?

    EDIT:
    When connecting using battery (without USB) then it's OK!
    So what am I missing here?

    SOLUTION [ DrAzzy ]:
    Put 0.1uf capacitor between ground and power right next to each LED.
    Or consider already soldered solutions.

About

Avatar for moka @moka started