Introduction
You might have already tried your hands at making a two colour LED module blink with the micro:bit, but have you tried using an RGB LED module?Â
In this guide, you will learn to make an RGB LED blink and change to a variety of colours.Â
Complete this guide to learn the basics of programming an RGB LED!
If you're using the Micro:bit Advent Calendar, you'll need the contents of the bags labelled 2 and 25.
-
-
-
-
-
-
-
-
-
basic.forever(function () { pins.digitalWritePin(DigitalPin.P0, 1) basic.pause(500) pins.digitalWritePin(DigitalPin.P0, 0) basic.pause(500) pins.digitalWritePin(DigitalPin.P1, 1) basic.pause(500) pins.digitalWritePin(DigitalPin.P1, 0) basic.pause(500) pins.digitalWritePin(DigitalPin.P2, 1) basic.pause(500) pins.digitalWritePin(DigitalPin.P2, 0) basic.pause(500) }) -
basic.forever(function () { pins.digitalWritePin(DigitalPin.P0, 1) basic.pause(500) pins.digitalWritePin(DigitalPin.P1, 1) basic.pause(500) pins.digitalWritePin(DigitalPin.P1, 0) basic.pause(500) pins.digitalWritePin(DigitalPin.P2, 1) basic.pause(500) pins.digitalWritePin(DigitalPin.P2, 0) basic.pause(500) }) -