Time to begin a new series of How to Program

Ok, Fall has arrived and with it, I want to start a new series of tutorials geared toward the newbie programmers.

Please help me to figure out the level at which we should begin.

  • I know zero about programming
  • I know JavaScript
  • I know Arduino/C
  • I know less than zero about coding
  • Iā€™ve dabbled but Iā€™m pretty lost

0 voters

4 Likes

So looks like, clearly, we have a group who needs to start from near zero, and a larger group who might have a bit of knowledge but needs grounding so they donā€™t feel so lost with PB.

No shame here, the poll shows you arenā€™t alone, and Iā€™ll work on a set of ā€œlessonsā€ that walks thru the basics of PB language/functionality.

2 Likes

Iā€™m so happy to see someone take on the challenge of teaching average, mere mortals how to create basic patterns. I have three degrees: BS EE 1970, COM SCI 1995 from Iowa State University and an MBA from Stanford 1977. Maybe because Iā€™m 74 and never programmed or designed professionally but I find this approach using JavaScript very non-intuitive. Where are the FOR loops, how do I turn on one or more LEDs for exactly 1s and what color is .2458?

If you can start at the beginning and work up to just the basics like chasing and stacking LEDs, I would be eternally grateful. Forget the cosine(cosine(tangent(sine + 1)) + 2).

Thanks

1 Like

So JavaScript is actually not the issue hereā€¦ We have for loops, but unless you understand how the PB ā€˜engineā€™ works, itā€™ll actually work against you trying to just ā€œmake it do stuffā€.

Turning an led on for exactly one second is actually quite hard in PB, but we can get very close to it, most of the time.

And as for the color of .2458, itā€™s a shade of green-yellow. (And yes, I had to go figure that out, but I actually used a nonPB website to do so, because I understand how some other people measure color differently than PB does. And then I goofed it as I thought the quickly googled website I used was using 256 values, but it uses 360)

Iā€™ll explain all of these and moreā€¦ And weā€™ll avoid the sine and cosine stuff till you understand why we use them and how.

3 Likes

Looking forward to thisā€¦ :slightly_smiling_face:

Iā€™ve done plenty of coding (quite literally decades ago), often in assembler, sometimes in C. I am mostly a hardware guy. So I get the basics, but I would benefit from something at the ā€œhow to turn an idea into codeā€ level, and assuming no real knowledge of JavaScript. Of course, I will also learn from more basic stuff. In the meantime I am able to enjoy hacking around with my own ideas and learning from other posts on this forum.

1 Like

An interesting note on the state of the survey, at 23 responses, not ONE has said they know JavaScript. Lots of new coders (easily half, likely more), a smatter of experienced folks, but the one group Iā€™d expect to see more of, folks who know JavaScript but want to learn more PBish specifics, no sign of. Weird. I think this continues to point out a huge untapped market, @wizard, of the millions of JS coders who donā€™t know PB exists, and end up using WLED or raspberry pi, or other nonJS tools to do LEDs who would likely purchase a PB if they realized how much theyā€™d be able to easily code with it.

Definitely an untapped group of folks. I think perhaps this is already filtered group of responses given the topic.

Learning to code and making it easier are goals Iā€™ve had for PB, so Iā€™m very excited to see everyone here looking to learn!

1 Like

Perhaps, but Iā€™d have expected a percentage who were JS fluent but wanted to learn PB specifics, and intentionally allowed folks to pick 2 answers, to cover those sort of overlaps.

Based on most of the vocal users (not just this poll), our percentage of JS fluent users on this forum is way way lower than it should be.

Itā€™s definitely hard to size the number of people who are not on the forum because they got their needs filled with default patterns (either no need to customize them, or found the examples sufficient).

Then thereā€™s probably people who know how to program and thus skipped reading this topic/voting. I didnā€™t vote because it said it was geared towards newbie programmers.

This poll had a high number of total responses compared to prior polls. I think time spent on content for them is really well spent.

3 Likes

Iā€™ve got one project that Iā€™m tinkering with, because I want to add sound to the Block Reflections pattern. When I started digging into the code, Iā€™M LOST! Iā€™ve always been code-adjacent, and have only half-assed started to learn coding before getting too busy to really learn well.

Working off a V2, but just ordered a V3 and pico.

Iā€™m a tech writer for a living, so maybe I can offer some help in documenting the how-to?

2 Likes

Happy for all feedback as I goā€¦ Adding sound is absolutely not a 101 topic, because you need to understand so much first. That said, I recently discussed how to add sound to a pattern, in a very abstract way.

1 Like

Thanks for the link. Iā€™ll take a look later after work today. My plan was to compare Blink Fade to the Sound version of Blink Fade, and see if I could figure it out. The art panel Iā€™ve created looks fantastic with Block Reflections, and Iā€™d love to add a sound element to it.

I wasnā€™t so much suggesting that sound should be in 101, just that my attempts to figure out sound made me realize how badly I need the 101!

1 Like

I wonder if this is partly a function of the age of the responders. Iā€™m in my early 50ā€™s. I got a CS degree back in the early 90ā€™s using Fortran, Ada, Modula-2, C, and a little assembly. JavaScript didnā€™t exist. I got a job as a Unix Systemā€™s Admin and went that direction for many yearsā€¦ so add in shell scripting and Perlā€¦ but largely programing was never really used except to make a tool to do specific functions needed in my job. I then picked up some Pythonā€¦ but oddly never to Java nor JavaScript. Now I do software support of a large application but again no real programmingā€¦ more customer managing. So for me I have been away from real coding for like 30 yearsā€¦ I learned some in school but then never really used it in a job so it was mostly forgotten. Leds bring me immense joy :slight_smile: but itā€™s a battle to get my brain to think programmatically. Sure I understand the basics(looping, conditions, variables, etc) well. I find it fascinating the way others are gifted in math knowledge or bit manipulation etcā€¦ which my brain takes way too long to follow along. I really appreciate the community here and the number of different ways you are all trying to teach/help us. I happened into this world(PB) by being a Jason Coon fan and seeing him mention PB in a couple projects. I was working thru the FastLED worldā€¦ but am enjoying the instant ā€œgratificationā€ of the PB.

1 Like

I guess we need some demographics to confirm or refute that.

Iā€™m in the same age range, so I started with BASIC way backā€¦

I think given data like this:

JavaScript is now used by more than 16.4 million developers globally, says a survey of more than 19,000 coders ā€” making it the worldā€™s most popular programming language ā€œby a wide marginā€

And thatā€™s not new, itā€™s been the most used language for many years now.

My feeling is that PB has a huge untapped audience of JS coders who would use it over WLED and FastLED (in C), Micropython (microcontrollers), or whatever options are available for a Pi (pretty much any you can think of), BUT few have heard of PB. The problem isnā€™t a lack of audience, itā€™s a marketing failure to reach the people most inclined.

1 Like

I would have to agree that the word has just not really gotten out about PB. I only happen onto it because I saw Jason mentioned it. ā€œA happy little accidentā€ as Bob Ross would say. I had no idea all that existed until I started actively looking/searching for what was out there in the DIY world of Leds and microcontrolers.

1 Like

I too am in my 50ā€™s and have worked in tech for the last 30, but Iā€™m interested in following along. I mostly code in shell, Perl, & Python, itā€™s been decades since I wrote anything in a compiled language. So I have a great grasp of programming, but not the specific stuff fundamental to writing for the PB.
Plus, my particular use case is a little different from a lot of people in that Iā€™m using it to drive my faux Nanoleaf panels and I want to do stuff thatā€™s unique to that kind of layout.

2 Likes

Iā€™m pretty comfortable with whatever code is written in to modify and to extend. I keep seeing a lot here on the forums about pixelblaze and the learning curve, the difficulty etc but Iā€™m still pretty lost at exactly what that is referring to. As far as Iā€™ve skimmed (still working on the physical build side thus far) thereā€™s mainly beforeRender and render (+render2d +render3d). Then I see the code heavy on math for various patterns.

What I hoped to find as a programmer myself (that doesnā€™t like to re-invent the wheel per-se), is an API documentation for either the pixelblaze core, or some higher level type abstraction someone has written to sit on top.

I know the core methods are documented and there are examples here itā€™s just not really what I was expecting. Thatā€™s just the honest truth as a developer coming into this without any idea what it was just a few days ago.

Ideally. I want to build upon the work of others an their patterns quickly, not figure out myself how to start from scratch.

1 Like

Is the written documentation on the PB language not enough for you as an API? What more do you want? Unsure what sort of abstraction would be helpful to you, as itā€™s already abstracted in the sense that @wizard hides the low level stuff already. We donā€™t have access to the pixel buffer (yet), as an example.

Serious questions, as Iā€™m trying to figure out why so few people seem to have discovered the power of PB.

A large chunk of the base isnā€™t coders at all (or not comfortable with how to get started).

I keep hearing people complaining about the math (which is more about the nature of computer graphics, 2D and 3d, and so onā€¦)
Between the many existing videos/articles from the likes of Inigo Quilez, Dan Shiffman, Grant Sanderson and many more amazing educators out there, Iā€™m not planning on delving deeply into the math anytime soon, except specifically to understand how pieces of PB work (so mapping, for one example, and itā€™s really hard to discuss sin(), let alone function like wave() without discussing the math behind them)

I realize Iā€™m the exception to the rule, but I usually find myself soā€¦ Iā€™m a self taught computer geek, math savvy, and I devour videos/articles like the above. PB lies in the intersection of a number of my interests, and perhaps Iā€™m just lucky enough to fall into it with enough background and grasp of concepts that I pulled it all together. Understanding where other people get stuck is important but non-obvious to me, as Iā€™m not there.

Itā€™s not that the current documentation or coding paradigm is wrong! - itā€™s just that it didnā€™t align with what I expected to find. And I donā€™t have anything like a perfect vision either! But thatā€™s my feedback thus far, is that I was met with something different than I expected.

I expected to find something like this:

pb = init( 3dMap );
shape = pb->addElement( 'expanding-sphere', locationX, locationY, locationZ );
shape ->mapHue( inputPin, inputVoltagHigh, inputVoltageLow );
shape->then( shape->reverse() )->loop()
2 Likes

Hahah, you want objects? You want properties? Oh boy, I have some disappointing news for youā€¦ (grin)

Iā€™ll be writing up more about this in the next lesson or two. 'Pixelblaze JSish" is actualy pretty clean, for what it does, and kudos to @wizard for his slow expansion adding many new language features, not merely for adding to esp32 based v3, but also backporting it to the esp8266 based v2. Heā€™s been pretty clear on the limits of the language, and pushing them slowly. Heā€™s added lots of array functions, and a transformation API, for example.