Is there a limit to the use of when block hats with Microblocks ?

Issue #412 resolved
Tom Ming created an issue

I would like to use IR controler with MB,

I refer to the tutorial , and design a program which is shown as below.

But it seems that there is a limit to the use of when block hats,only nine of them can be activated when press START.

Comments (3)

  1. John Maloney repo owner

    Yes, that is correct. Each "when" hat runs as a task and each task requires a certain amount of RAM for stack space so there is a limit of 10 total tasks. (Your "when started hat" is also a task.)

    It is the same limit on all of the boards that MicroBlocks supports, even though some boards have more RAM than others. That makes MicroBlocks code more portable.

    In this case, I would probably combine all the IR code scripts into a single script that receives an IR code and stores it in a variable, then uses a IF statement decide what to do based on the code received.

    Hope that helps!

  2. Log in to comment