Using this basic example code from microbit, blinking heart, I tried to change the delay of blinking with the pause argument. However, the minimum actual blinking frequency is around 500ms, no matter what value i put.
Do you know why, and how I can achieve much faster blinking with led patterns (like show_icon
or show_leds
function).
def on_forever():
basic.show_icon(IconNames.HEART)
basic.pause(50)
basic.show_icon(IconNames.SMALL_HEART)
basic.pause(50)
basic.forever(on_forever)
Thanks.
You have tagged this as
micropython
but I don't believe that is what you are using. I think you are running with the Python in the MakeCode editor.Looking at the help page for for the MakeCode show_icon, it says it is called with:
with the following details about
interval
:As you were not putting a value for
interval
it was defaulting to600
milliseconds which meant your code was putting650
milliseconds delay between each icon.I was able to vary the duration an icon was displayed with the following: