+21622886281
Micro:bit RGB LED

Control the lighting of RGB LED module using the Micro:bit buttons

Purpose of this tutorial:

In this tutorial we will control the switching on of an RGB LED module via the two buttons A and B of the micro: bit card:

1- When button A is pressed, the LED lights up in red.

2- When button B is pressed, the LED lights up green.

3- When pressing the 2 buttons A and B at the same time, the LED lights up in Blue.

Mounting

We connect:

  • the Po pin of the Micro:bit card to pin (R) for the red color of the RGB LED module
  • pin P1 of the Micro:bit card to pin (G) for the green color of the RGB LED module
  • pin P2 of the Micro:bit card to pin (B) for the blue color of the RGB LED module
  • the GND pin of the Micro:bit card to the (GND) pin of the RGB LED module 

Components required

  • Micro: bit card RGB LED
  • module micro: bit GPIO Expansion Board (for mounting 1)
  • connecting wires 

There are many mounting methods and here are some examples:

Mounting (1)

Mounting (2)

Makecode program

Here is the makecode program which allows you to control the switching on of RGB LED with the Micro:bit buttons.




0 commentaire


Leave a comment

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Scroll to Top