• Try the following:

    var esp = require("ESP8266");
    var pin = new Pin(15);        // I've tried all available GPIOs
    pinMode(pin, "output");
    esp.neopixelWrite(pin, [50, 50, 50]);
    

    It may be that setting the pinMode explicitly to output is required.

  • Unfortunately that hasn't helped. I managed to get SPI1 working occasionally but only by putting a number as padding at the start of the array, but that still only seems to work some of the time.

    SPI1.setup({baud:3200000});
    var r = 25;
    var g = 25;
    var b = 25;
    SPI1.send4bit([10, r, g, b], 0b0001, 0b0011);
    

    Edit: with more testing it seems almost random what colour comes out compared to the array that gets sent.

    Edit 2: The hardware SPI seems to give a different output even if I send the same command several times, it looks like a timing problem to me, but that's a guess from playing around with the baud rate. It looks like software SPI is the only option for me at the moment.

    Edit 3: This works, but don't ask me why. The timeout and the leading 0 in the array are essential for it to reliably output the correct colour.

    SPI1.setup({baud:3200000});
    setTimeout(function(){
      SPI1.send4bit([0,10,10,10], 0b0001, 0b0011);
    },100);
    
About

Avatar for AlexOwen @AlexOwen started