Warn user when loading project that doesn't match board capabilities

Issue #118 new
John Maloney repo owner created an issue

Should we warn users when they load a project that requires capabilities that are not supported by their board (for example, loading an HTTP project onto a board without WiFi)?

This is tricky. Most examples can run on multiple boards. Some of them expect external hardware to be attached (e.g. a speaker attached to the micro:bit).

Since our primary audience is education, we're assuming that most users will have a board with micro:bit like functionality: an actual or simulated 5x5 LED display, two buttons, and a tilt sensor. Except for "Blink", most of our example programs won't do anything useful on a bare-board microcontroller such as an Arduino or ESP8266 board. (In fact, some ESP8266 boards either don't have a user LED at all or have it connected to a different pin than MicroBlocks expects, so even Blink doesn't work on those boards without modification.)

My current assumption is that folks using bare-board devices are already knowledgeable, so they won't expect most of our examples to work on a bare board. They'll also expect to modify the pin numbers for examples that use external devices (speaker, servos, sensors, NeoPixels, etc.) to match their hardware connections. This group probably does not need any extra warnings (and might even find them annoying).

For beginners, we've tried to segregate our examples to indicate what capabilities are required. For example, all the examples that require WiFi are in either the Web Things or Network folders. Examples that require a TFT either say "(needs TFT)" in the project name or appear only in the "ED1 and M5 Stack" folder.

It's fairly innocuous to try to run a MicroBlocks program that requires features not supported by the board. It doesn't crash or even give an error; the unsupported operations (e.g. TFT commands) are simply ignored. 

That said, it might still be helpful to give warnings for a few special cases:

  1. loading WiFi projects on a board without WiFi
  2. loading TFT projects on a board without a TFT

Of course, users may just want to look at the code for such projects, even if they can't run them. We don't want to prevent loading such projects, and the warning should be lightweight.

Comments (2)

  1. Turgut Guneysu

    I vote for highlighting the blocks in question to indicate feature mismatch.

    Regardless of user sophistication, it is always prudent to highlight the code issues.

  2. Log in to comment