keyestudio
Share your creative ideas with us here
By Alisa | 15 May 2024 | 0 Comments

How to Make a Breathing LED with Micro:bit?

Overview
 

The light breath experiment is a little bit similar to the previous project. This time we connect the keyestudio LED module to the sensor shield. Connect the Signal pin of LED module to P0 of micro:bit. From the Pinout diagram of micro:bit, you can get the P0 can be used as Analog IN.

This lesson you will learn how to control the brightness of LED on the module, gradually becoming brighter and dimming, just like the LED is breathing.
 

Component Required:
 

  • Micro:bit main board*1

  • Keyestudio Micro bit Sensor V2 Shield*1

  • USB Cable*1

  • keyestudio Digital Red LED Module*1

  • Dupont jumper wire*3

  • Premium Battery Holder 6-cell AA*1

  • 1.5V AA Battery*6


Component Introduction
 

Keyestudio Digital Red LED Module:
 

This keyestudio digital red LED module has 3 Pins; - pin is connected to ground, + pin is connected to VCC(3.3-5V), S pin is for signal control; you can set the High or Low level to control the LED on and off.

Connection Diagram

3


Test Code
 

Img


Test Results
 

Done wiring and powered up, send the code to micro:bit, you should finally see an LED on the module gradually become brighter, then gradually dim, circularly just like the LED is breathing.

Leave a Reply

Your email address will not be published.Required fields are marked. *
Name
E-mail
Content
Verification code