Create the rainbow iterating over hues.
Smoothly change the RGB LED A color, by iterating over different hue values from 0 to 100.
basic.forever(function () {
for (let index = 0; index <= 100; index++) {
sb.setRgbLedColorHSB(sb.rgbLed(SBRgbLed.RgbLedA), index, 100, 100)
basic.pause(100)
}
})If using micro:bit for the first time, follow this setup.