Yes. Thanks. I found the Pixekblaze expression docs and they are very helpful.
Still, some expressions and syntax are obscure. One example: =+… And simple math expressions apparently JS derived but documented… where.
Anyway, chugging along here.
I imagine a searchable lookup file would be super useful.
Bingo. Assuming deep JS knowledge is the main “issue” with the existing document. Totally fixable. I’m not sure adjusting the existing document is the answer, so much as a “Newbie” version meant to hand hold thru the basics.
That said, someone asked about a Blockly type interface. Give that it runs on the browser, I wonder if that’s easily addable (since JS blocks exist, this would be mostly stripped down version)
Either way, the target audience is the same: newbie PB users without much if any coding experience.
Pretty much. Just a reference document to assist with deconstructing existing pattern code to learn what’s going on would help.
I have lots of operational knowledge with finite element, heat transfer and other mostly energy-related modeling but not JS… So, a new modeling and control environment! Cool!
I am among the “newbies” here who could “crash-test” such a doc.
Is there somewhere that I could download the code for the patterns that are in the pattern library to view them in text rather than in the pixel Blaze interface?
Also, if you just want a big collection of source code files, this works for now (but will eventually be taken down when the next iteration of the pattern library is out, which will be backed by this repo)
Unfortunately blockly is far too large to embed in Pixelblaze. Something similar could be found or created of course… I think rather than blocks more of an audio input/output mapper kind of visual editor could work well. Maybe something like https://nodered.org/ which seems to have been used to build Teensy’s audio system design tool https://www.pjrc.com/teensy/gui/ Things like this might turn the problem from a textual to a point and click interface, it doesn’t inherently change the “programming” skill challenge.
Of course a cloud/internet based app could spit out PB code.
I’m interested in enhancing the textual interface for code, improving documentation, and writing or curating tutorials for all skill levels. I’ve been looking at adding autocomplete, and built-in hover docs like IntelliSense.
I was thinking more than it would be loaded from a page like Blockly.pixelblaze.com but unsure if https crosssite is an issue
Added later: I suspect it would be, because blockly is basically adding a handful of js to be loaded onto the page. However…
Someone seems to have gotten an esp32/8266 proxy working, I wonder if serving up specific files (ie custom js files hosted by you) could be used to store the js on the web, and the editor page (if this is turned on) just adds the “local js” which, when the browser loads, it asks the PB for the js as well, and the PB then proxies in the js from PB.com
Generally, I think I’d prefer just a documented interface for loading/storing/parsing pattern code (and for reading/writing maps as well!). That way it’d be possible to make extensions for Visual Studio, PlatformIO, Eclipse, etc.
You’re at the other end of the spectrum here, @zranger1
At that point, WLED or FastLED also work.
The “nonprogrammer” who is an artist or otherwise wants to do cool LED stuff but isn’t going to learn tons of coding should still be able to do basic custom things in PB beyond just clicking a pattern and sliders.
Looking at the non-block GUIs, I actually agree they would be awesome, but that’s way more work, and likely more limited, because probably have to write to a format that lends itself to inputs and outputs. Which is still a huge playfield.
I’ll have to research some more. The block customizing might just let a hybrid work. I have an idea…
@Scruffynerf one of the key design constraints of Pixelblaze is that it works stand-alone, without internet access (but obviously with WiFi). Theres a subtle line between a website that runs blockly or something and can send that to a Pixelblaze, and Pixelblaze units themselves having and interface that requires or partially requires internet access.
The near future plans include some kind of cloud based firestorm, or at the least a way to attach PBs to a server/service, where additional functionality (perhaps like blockly editors) can be added.
I is zero, each loop, add one to I, until I is one less than the number of pixels, then do whatever, and loop back and add one to I…
Starts with I is zero, first time thru …
There’s two ways I use to estimate the time it takes to compute all LEDs (a frame) for a given pattern and number of LEDs.
1. Compute the inverse of FPS
FPS stands for Frames Per second and is always displayed in the top right corner of the Pixelblaze web IDE. The inverse (divide 1 by FPS) will be the number of seconds per frame; multiply by 1000 to get ms per frame.
80 FPS = 1/80th second per frame.
1/80th * 1000ms/s = 12.5ms
2. Use the watcher to monitor delta
The argument passed to your beforeRender() is the number of milliseconds since beforeRender was last called. It’s usually named delta, so you see it as function beforeRender(delta) {}
You can see a variable’s current value in the watcher if the variable is declared as exported and you’ve enabled the watcher.
export var lastDelta
function beforeRender(delta) {
lastDelta = delta
}
Here’s an example, and you can do the math to see how it correlates well with the displayed FPS: