• Try the following:

    1. var esp = require("ESP8266");
    2. var pin = new Pin(15); // I've tried all available GPIOs
    3. pinMode(pin, "output");
    4. 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.

    1. SPI1.setup({baud:3200000});
    2. var r = 25;
    3. var g = 25;
    4. var b = 25;
    5. 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.

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

Avatar for AlexOwen @AlexOwen started