BlinkPlus

Description

This example program implements the mandatory “blinker”, however using two cores (hence: “plus” :). Since there’s only one LED on the Pico, one of the cores simply periodically writes a message to its terminal in lieu of blinking a LED.

After 20 seconds, both programs cause a run-time error to demo the runtime-error handling, separate on either core. Comment out the corresponding lines to enjoy continuous blinking and messaging.

Running two programs on the RPs’s cores is really simple. Basically.

The programs for the two cores can be implemented in one module, or two. They are just parameterless procedures. The example uses two modules, BlinkPlusC0 and BlinkPlusC1, just to show this possibility. Not that it’s needed considering the complexity. Using two modules for two programs allows to test them independently on core 0.

All library modules of Oberon RTK are re-entrant. If you use your own, make sure they are as well, in case both cores use the corresponding code.

See Text Output and Input about the implementation of module Out for two cores.

Output Terminals

See Set-up, two-terminal set-up.

Build and Run

Repository

  • libv2:
    • for RP2040/Pico: BlinkPlus, using the one timer of the RP2040
    • for RP2350/Pico2: BlinkPlus, using the two timers of the RP2350
  • lib (v1): this version is no longer being maintained: BlinkPlus