modelHeart
The LED matrix shows a beating heart: Image.HEART and Image.HEART_SMALL alternate every 500 ms
Extends from Modelica.Icons.Example (Icon for runnable examples).
Information
Expected result: the dots of the 5x5 matrix on the icon of mb light up in a heart shape (brighter while Image.HEART is shown than during Image.HEART_SMALL), and the LED currents in the plot (mb.led_x_y.mean.y) show the 60 Hz multiplexed scan of the rows.
The program is written for the official micro:bit MicroPython API (from microbit import *) and runs unchanged on a physical micro:bit.
Components
| Type | Name | Default | Description |
|---|---|---|---|
| MicroPythonMCU.MicroBit_v2 | mb | Program: Resources/Scripts/MCU/microbit_heart.py | |
| Modelica.Electrical.Analog.Basic.Ground | ground | ||
| Modelica.Blocks.Sources.BooleanConstant | btnA | button A idle | |
| Modelica.Blocks.Sources.BooleanConstant | btnB | button B idle |