Coding practice while waiting on V3?

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.

Oh I agree. I saw this as “value add”: Turn on a “use blockly (requires internet access)” setting and it would add the includes to the editor page.

I’m going to play with doing it via a userscript and see if I can make it all work.

I’m picturing a BeforeRender block, Render block, Render2D, etc. For all of us who program naturally this isn’t needed.

I really like the Teensy Audio GUI but it’s huge.

I see this is quite a deep topic. And I am going to rely pretty strongly on the assembled brilliance here…

For now, if I could inquire as to the (basic) meaning quick intro to the following terms/phrases -

PI2 Is this Pi squared? The number? But there’s PISQ…
Following would be PI3_4…

Then a few terms from the blinkfade pattern -

array
for ( 1 = 0; i < pixelCount; i++)

random(max)… in this case randon(1) which is the maximum b=value for max ?

And this one, really cool, I think from somewhere I don’t remember -

timer…

OK. Perhaps better to ask these scattered things in a separate topic, or in the Random Project 1 Forum. Please let me know.

ps I’ve got a PB v 2+ to play with now!

2 PI (6.28…) useful for Radian math (angles)

PI *3/4

Also often useful.

See

Search for the rest, I know we have discussed timer and random recently.

The blinkfade code I’d have to go look at, someone else know the answer?

Thanks. There’s a typo above in my post… its not

but rather

for (i =0; i , pixelcount; i++)

I get that for is a looping command… (in my own lingo)

Ah, without the typo, makes more sense.

Yes, it’s a For loop.

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 …

1 Like

Hey @Gandalf!

I too once wondered why it was PI2; but in PB/JS/many languages, you can’t start a constant name with a number, so 2PI isn’t an option :smiley:

For your question about timers like t1 = time(PERIOD), check out this section of the Intro pattern (which will be loaded on your v3):

1 Like

This is very cool, and looking forward to that V3.

For now, I’m wondering how one determines this -

Sorry if I missed it somewhere… I seem to remember it being rather introductory.

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:

Pixelblaze 2021-02-06 19-03-08

So it checks out. 18ms ~= 1000ms / 53FPS.

2 Likes