4 Replies Latest reply on Apr 7, 2015 3:24 PM by nikidles

    Addressable LEDs and Edison

    nikidles

      Hello all,

       

      I am desperately trying to get my addressable LED project up and running. I have an Edison on the mini-breakout board connected to an addressable RGB LED, with the ground and power connected properly, and the data-in pin connected to J17-12. Is this setup correct? The LED is constantly on but will never change colour based on my writing. So far my code is as follows:

       

      var mraa = require('mraa');

      var spi = new mraa.Spi(0);

       

      var buffer = new Buffer(3);

      buffer[0] = 255;

      buffer[1] = 128;

      buffer[2] = 128;

       

      var setLED = function()

      {

          console.log(buffer);

          console.log(spi.write(buffer));

       

          setTimeout(setLED, 500);

      }

       

                setLED();

       

      some example output of this is:

       

      <Buffer ff 80 80>

      <SlowBuffer 00 00 00>

      <Buffer ff 80 80>

      <SlowBuffer 00 00 00>

      <Buffer ff 80 80>

      <SlowBuffer 00 00 00>

      <Buffer ff 80 80>

      <SlowBuffer 00 00 00>

      <Buffer ff 80 80>

      <SlowBuffer 00 00 00>

      <Buffer ff 80 80>

      <SlowBuffer 00 00 00>

      ...

       

      I'm not sure if I'm creating spi correctly. Is a bus parameter of 0 correct? I have tried many things from all over this website and others, including setting the power mode of the spi bus to 'on' instead of 'auto'. I am on the newest version of Yocto using up-to-date mraa. Also, I'm not entirely sure what the difference is between SSP2 and SSP5. Also, should I be doing something with the SSP5 clock output? that makes sense considering what SPI is... but I'm simply not sure what to do.

       

      Any help is appreciated, thank you.