LED Blinking in Various Combination

by Srishti Dhoundial in Circuits > Microcontrollers

41 Views, 0 Favorites, 0 Comments

LED Blinking in Various Combination

Screenshot 2024-05-07 081434.png

In this tutorial, we will delve into programming the STM32 "Black Pill" development board using STM32CubeIDE to create diverse LED blinking patterns. The Black Pill board employs the STM32F103C8T6 microcontroller, while STM32CubeIDE serves as a robust integrated development environment tailored for STM32 microcontrollers.

Supplies

Screenshot 2024-05-07 081326.png

Following supplies will be required-:

  1. STM32 Black pill
  2. 3Led's
  3. Breadboard
  4. Jumper Wire
  5. USB type C cable
  6. STM 32 Cube ide
  7. STM 32 Cube Programmer


Configuring the GIPO'S and LED

Screenshot 2024-05-07 060531.png
  1. In STM32CubeIDE, navigate to the "Pinout & Configuration" tab.
  2. Configure three GPIO pins for controlling LEDs (e.g., GPIOA Pin 0, Pin 1, Pin 2 for Red, Green, Blue LEDs).
  3. Set these pins as GPIO Output and enable GPIO clock.


Code for LED Blinking

Screenshot 2024-05-07 082152.png
Screenshot 2024-05-07 082203.png

Hardware Setup

  • Connect your STM32 Black Pill board to your computer using a USB cable.
  • Build the project by clicking on the hammer icon in the toolbar.
  • Once the build is successful, click the play (debug) button to flash the code onto the board.


LED Blinking Result

Screenshot 2024-05-07 080157.png

The STM32 Black Pill board to control LEDs in different blinking patterns using STM32CubeIDE. we can do further by adding new patterns or modifying the existing code to create more complex LED sequences.