Cover image
    Activity

    Code a micro:bit to Wave 10 Times

    Alternate between two positions before stopping.

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

    Code

    Wave 10 Times

    00:10

    Alternate between two positions of Servo A, on repeat 10 times before stopping.

    for (let index = 0; index < 10; index++) {
        sb.setServoPosition(sb.servo(SBServo.ServoA), 20)
        basic.pause(1000)
        sb.setServoPosition(sb.servo(SBServo.ServoA), 80)
        basic.pause(1000)
    }

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