Avatar for Drarok

Drarok

Member since Dec 2016 • Last active Oct 2017
  • 5 conversations
  • 21 comments

Most recent activity

  • in Puck.js
    Avatar for Drarok

    Hah, brilliant! I built a little library to make it a little simpler for myself – I kept mixing up pixel index and the fact that each one is made of 3 array elements.

  • in Puck.js
    Avatar for Drarok

    I've powered the ring off the 3.3v line of my power supply, and connected D30 direct to the ring's data pin, and now it's working!

    Every so often, it has a bit of a wobble, but I think there's weird capacitance or grounding issues making the signals a bit unreliable.

  • in Puck.js
    Avatar for Drarok

    @Spocki – Hmm, that's weird. I read elsewhere that they need a 5v supply and data line.

    @Gordon – ah, amazing! I'll update to 1v92 and see how I get on after that. Thanks!

  • in Puck.js
    Avatar for Drarok

    I've got a Neopixel Ring (12 LEDs), and two Pucks. I know they run on different voltages, so I've connected the Neopixel to a 5v USB supply, and used an opto-isolator to drive the data pin at 5v from the Puck.

    I can't figure out how to make it work, though.

    I've cobbled this together from various posts that I've found, but I assume I'm doing something wrong (or the Puck can't do the data rate I need perhaps?):

    const PIN = D30;
    const LEDS = 3;
    
    function main() {
      pinMode(PIN, 'output');
      // I'm using 400000 here because I read they need a 4- or 8kHz stream, but no dice.
      SPI1.setup({ baud: 400000, mosi: PIN });
    
      let arr = new Uint8ClampedArray(3 * LEDS);
      let idx = 0;
      for (let i = 0; i < LEDS; ++i) {
        arr[idx++] = 255;
        arr[idx++] = 0;
        arr[idx++] = 0;
      }
    
      console.log(arr);
      SPI1.send4bit(arr, 0b0001, 0b0011);
    }
    
    main();
    

    I've confirmed that the isolator can do upwards of 50kHz, and that it's working (by using a plain LED and setting D30 high – it lights from the 5v rail).

    Help! Thanks in advance.

  • in Puck.js
    Avatar for Drarok

    I've got a 3.3v power supply unit which I was using, but later also tried it just off the battery.

    I've no idea what was causing the dimness – that's since gone away. Bad wiring or dodgy configuration is entirely likely!

  • in Puck.js
    Avatar for Drarok

    I don't know what 'bias' means in this context.

    I'm a developer, so confident of my code, but an electronics noob. Pretty sure it's working sensibly now, but either my breadboard has a bad connection with a wire, or I've soldered a wire badly. I wouldn't know how to share a schematic either, other than to take a picture of what I've got!

    Thanks for your help though. 👍🏼

  • in Puck.js
    Avatar for Drarok

    And now it's not working at all again, and I've no idea why! 😭

    Edit: I think that failure was a dry joint or bad wire. Ugh!

  • in Puck.js
    Avatar for Drarok

    Oh! Well, that's interesting.

    I've switched to using SPI1.write(0b01000000, PINS.LATCH) and that almost works perfectly, except when I turn two adjacent LEDs on, one of them is extremely dim. I suspect that's just bad wiring or low battery, since if I turn them on individually, they work fine.

    I can't believe it was such a simple mess up on my part. Thanks!

Actions