LoL Akali Mask ( battery-powered APA102 setup ) #2854
Replies: 11 comments
-
Posted at 2019-01-25 by stephaneAG ( no enough space in one post .. ) The debug code currently handling the logic is the following
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-01-25 by stephaneAG The code generated by the Illustrator script & the Illustrator script ( CS5+ ) lies below
Illustrator script, where logic is:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-01-25 by stephaneAG .. and the code that tries ( in a very dumb manner currently ) to find the shortest path between all dots ( it 'd be neat if it was optimized & not accepting lines crossing among other stuff, but this is a very quick & dumb take on the travelling salesman problem or one of its derivative ? .. ) If someone want to have fun ,why not allowing to specify ( or not ) start and/or end points & then let the magic happen ? so, the ( ugly ) code, enjoy ! :)
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-01-28 by @gfwilliams Hi,
Probably Could it be that your hardware SPI is just going too fast? With a long wire and a 1.5k pullup it might just not be enough to produce a clear signal. Do you have an oscilloscope?
Could be the output speed as above. It's worth noting that hardware SPI doesn't decrease CPU usage, so actually the gains from it are not as much as you might think.
Maybe, but honestly there are other things I would try first like removing Honestly I think for everyone I've seen that has tried to use
As above really - it could be the SPI speed you're trying to use with the level shifting via resistor. If you have an oscilloscope it would be a huge help. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-02-01 by stephaneAG Hi there, 1: I'm currently using B3 & B5 ( yup .. ), but I guess I'll switch to B13 & B15 or just use software SPI instead + 'opendrain'. I'll try the long wire + 1.5k pullup to 3.3V ( on both datat & clk or just one iyo ? ) - I can borrow an oscilloscope ( .. ) 2: understood for the "no that much gain" ;) 3: yup for the logs ;p, and I'll try getTime benchmarking as you advise. Also I'll avoid compiled stuff for this particular goal ;) 4: I 'll manage to get myself a scope & learn its many tricks, yet as far as I can tell, the following seemd to work ( even without 'opendrain' -> anyway, I'll go for safety with your above suggestions )
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-02-04 by @gfwilliams I'd add pullups to both pins if you're trying to get a decent voltage swing on them. As far as SPI mode - honestly I don't know what the APA102 needs and I don't really have time to check, but if mode 0 works, use that - mode 0 is the 'standard' SPI mode that 99% of things use, so chances are it'll be that. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-02-06 by stephaneAG hello :) thanks for the hints ! ;) I'll have a try on this subject later today & 'll come back with the result |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-02-07 by stephaneAG Hi there ! back on this project ;p -> I received the said charger/booster and 'll test the pullups pins stuff ;)
https://forums.adafruit.com/viewtopic.php?f=8&t=147139. So, before trying the said pullup thing, I have to try powering ~40 leds fully bright from one ( or more in parallel ? ) 3.7V 18650 batteries & powering an original Espruino board ( maybe later a Pico but I no longer have any handy ; ) ), yet for programming/flashing/debug reasons, I wish to be able to keep the USB connection to the laptop. I currently disconnect the battery jst connector when being connected using USB while the leds are getting power from the 3.7V battery & no problem has rosen yet, but I'm wondering how the board would react if I were to keep both USB and battery on JST connected ( the leds are getting power directly from the battery, not from the Bat pin, when usb is connected or not ) This being said, I'm onto modding my current code to try the said ~40 leds, hoping I can have them 'blinking in sync' & last longer at least a minute .. ps: mode 0 seems to work reliably on my current setup, big thanks for the hint ;) last but not least, would you advise using external pullups when running off 3.7V & controlling 3.7V-powered leds ( without opendrain since no more needed ? I wonder how to fasten the said "voltage swing" .. ) -> I'll see if I can adapt some "rainbow scrolleré onto those as a test ;p |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-02-08 by stephaneAG Back with an alpha ( some things doesn't work as they should, and I'm still missing the finalized data ( timed mouth indices & mouths data ) ), but it's cleaner than previously ;) also, I managed to wreck my code somehow somewhere & now I can't control the last led any more :| if anyone's feeling brave enough to visually troubleshoot, be my guest ;) this being said, the pre-pre-pre-alpha code
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-02-08 by @gfwilliams No problem about running both off a LiPo. I do it all the time. In fact the docs in the reference page for the
The original board itself should work fine when plugged into USB and the battery via JST. It's got circuitry in there for it, and in fact newer 'Original' boards even have pads in there to solder on a LiPo charger :) The only one to watch out for is the Espruino WiFi. That has no JST connector and no battery switchover circuitry - so you can't just connect a battery to the power pins and plug in USB because you'll basically be shorting the battery across 5v! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-02-09 by stephaneAG All right, that one good news ! :) -> I was currently disconnecting the battery when connecting over USB but it seemed I could control the leds "ok" ( but maybe not as reliabiliy as when running everything off the battery ;p ) I'm currently working on how to optimise the leds/leds strip chunks so that I have the shortest non-crossing traces across the board ( I'm quite afraid using short wires 'll be quite hard since it'd unsolder one end while solderng the other due to heat .. I experienced that when joining two strip with a wire between both .. )
Ps: do you think I may have killed the last led on the strip by getting electrically shocked by touching it or is it just some code-side pb ? ( fact is: I tried loading previous versions of my code: still same trouble with the last one, aside from the scheduling maybe not as fast as expected & my test patterns not doing correctly .. yup, I have some mess to fix .. ) or would it come from me controlling leds powered via bat+ pin & no battery while connecting over usb ? :| .. ( I'm not sure how to test if an APA102 is dead or not, aside from directly connecting to it & sending controls to it only - thus this 'd mean a crack in the strip connection, which I doubt since it's not where I joined chuncks .. ) -> I'll check that once done with my mapping problems ;) ps: do you / does anyone have any knowledge / experience with "breadth-first search" & the TSP problem ? ( I could really get some help on either writing or modding an Illustrator plugin to do some related stuff .. ) thanks for the hints :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-01-25 by stephaneAG
Hi there !
I'm currently helping a friend building an animated "mask" from the LoL game, as seen on the following picture:

We plan to have a total of 8 different "mouths", and the idea is to use a set of daisy-chained leds positioned within different "cavities" to represent each desired "leds combo": by turning on or off leds in different "cavities", we display the mouth n ( more or less like a "segment display", but using LEDs )
The goal is to be able to start scheduled transitions betweens mouths at the press of the start button
Now, onto the needy greedy:
POC BOM:
The charger/booster may be replaced by the 1000C version ( allowing up to 2A, in contrary to the 500C which is said to provide 1A from 3.7V batteries - although I'm driving 16 LEDs while testing since it shall draw max (60mA/led)*16= 960mA )
It seems I'm getting somewhere in driving the LEDs thanks to this posts:
Thing is, I'm now sure these HAVE to be driven at 5V ( else I got erratic colors powering 1, 3 or 16 of those through the 'Bat' pin on the original Espruino board) so powering those from 3.7V battery directly is a no-go, but I'm unsure of the best setup to control them: the SPI seems to be 'somewhat glitchy', and I'm guessing sure this comes from the pin config and not the spi.write calls themselves.
I had some relative success driving 16 LEDs ( powered from BoostCharger 5V - actually 4.87V ) directly wired to B3 & B5, but in my tests, 'setInterval' wasn't 'as precise' as in my earlier test sketch ( in which I was using an OLED screen to display the mouth index & the timeout before a mouth update ). As the goal is to have 'somewhat precise' schedule for mouth updates, I think I have some things to pack right for this goal to be met ..
So here goes the questions:
*I find it quite weird that software spin kinda works but hardware doesn't
The debug code currently used to drive the LEDs is the following
Beta Was this translation helpful? Give feedback.
All reactions