Avatar for AdaMan82

AdaMan82

Member since Aug 2018 • Last active Aug 2018
  • 2 conversations
  • 14 comments

Most recent activity

    • 18 comments
    • 211 views
  • in Pico / Wifi / Original Espruino
    Avatar for AdaMan82

    Good point on the data sheet. I guess that makes the most sense. The issue applied on both with USB + battery and just battery pack. The working version does not use pinMode(B15,"af_opendrain").

    My programming background is basically VB in HS, some random C/C++/C# and excel macros, so hardly a pro. Just a baseline knowledge to make things happen.

    Either way, after overcoming the issue above, I have actually completely finished (the electronics part anyways) my project, and a aside from a brief flash at startup as it conducts onInit() and blacks everything out, which ultimately confirms that its turning on, it works perfectly.

    Now for the frigging 100 hours of 3d printing the pieces its going into.

  • in Pico / Wifi / Original Espruino
    Avatar for AdaMan82

    Alright I've got it all figured out. For whatever reason, (either by design or by fluke) my strip defaults to on, so on init I need to turn everything off before doing things off the battery pack. The reason is the draw is too high which makes the lights appear to be out or red when on. I anticipated this, but I did not anticipate the lights to be on by default. Here is how I executed the code to turn everything off, so I could then start turning what I want on:

    var rgb = new Uint8ClampedArray(300*3);
    
    function setOff() {
      for (var i=0;i<rgb.length;i+=3) {
         rgb[i  ] = 0;
         rgb[i+1] = 0;
         rgb[i+2] = 0;
      }
    }
    
    function doOff() {
      setOff();
      require("neopixel").write(B15, rgb);
    }
    function onInit() {
    doOff();
    }
    
    onInit();
    

    Wiring as per below. Moving the resistor also had an effect on how strong the lights that I wanted to turn on would be when I wanted them on.

    I can now turn the lights on at will. Big success.

    Thanks again for everyone's help.

  • in Pico / Wifi / Original Espruino
    Avatar for AdaMan82

    That's right. Ultimately it is one whole strip. zig zagging through the assembly.

    Ultimately 3 functions. One to increase the number (ideally illuminating the light its at), one to reduce the number (illuminating the spot its at) and one to generate a random 10 numbers up to and including where its at and leave them on for 3 mins.

    Its pretty straightforward (I think)

  • in Pico / Wifi / Original Espruino
    Avatar for AdaMan82

    I made a huge step. So all the lights go on by default, but I can turn them off manually with require("neopixel").write(B15, [0,0,0]); I can also turn specific ones on in correct colour combos. ALSO, the reddish colour is definitely due to voltage drop.

    I just don't know why it all defaults to but hey that's a start. The resistor and using the 3.3v output was the issue.

  • in Pico / Wifi / Original Espruino
    Avatar for AdaMan82

    Ok, so I've made some interesting progress.

    I have discovered that the whole strip lights up, but when connecting the 5v line from the strip to the 3.3v out on the Pico, and execute the following code:

    require("neopixel").write(B15, [255,0,0, 0,255,0, 0,0,255]);
    

    Those pixels go very dim but turn the required colour. The remainder of the lights stay on in a redish colour (which I assume is due to voltage drop but would otherwise I assume, be white).

    Its almost like its wired in revers but I have checked the hell out of things so I am fairly confident.

    In response to your questions:
    1) Tutorial: http://www.espruino.com/Individually+Add­ressable+LEDs
    2) Literally: just working with the line above

  • in Pico / Wifi / Original Espruino
    Avatar for AdaMan82

    No way more simple than that. See graphic below.
    Imagine the black bars being full slots in a holder, and the white bars being empty slots, that could be filled.

    [+] increases the length of the strip flashing the next light in the strip to show where the "max" is at for the random (green dot in this case).

    [-] decreases the length of the strip as per above.

    [rnd] lights up 10 random "full" slots (cyan dots as an example) for 3 minutes. If you press the button again, it lights up a new random 10 lights for 3 minutes.

  • in Pico / Wifi / Original Espruino
    Avatar for AdaMan82

    I tried using pinMode(B15,"af_opendrain") with the following setup (see attached image). Does that make sense? It doesn't work which just leads me to believe that I've used the resistor wrong.

    The whole thing still lights up. I tried also with 3xAA which outputs 4.5v but no dice.

  • in Pico / Wifi / Original Espruino
    Avatar for AdaMan82

    If I plug it in as above, all LEDs light up (decreasingly bright due to the 4xAA). A7 also produces the same results.

Actions