Cover image
    Activity

    Code a micro:bit to Make a Color Party

    Use a loop to continuously set the hue of the RGB LED A to a random value and change its color.

    Coding
    Get Started
    8-14+
    40:00
    micro:bit Coding Cards

    Code

    Color Party

    00:10

    Use a loop to continuously set the hue of the RGB LED A to a random value and change its color.

    basic.forever(function () {
        sb.setRgbLedColorHSB(sb.rgbLed(SBRgbLed.RgbLedA), Math.randomRange(0, 100), 100, 100)
        basic.pause(200)
    })

    If using micro:bit for the first time, follow this setup.