THREE LED PATTERN USING BREADBOARD

by Arshdeep singh in Circuits > Electronics

52 Views, 0 Favorites, 0 Comments

THREE LED PATTERN USING BREADBOARD

Screenshot 2024-04-10 174557.png

In this project, we're using a breadboard and an STM (System Target Management) setup to create a cool light pattern with three LEDs. It's like making a mini light show! By arranging and controlling the LEDs, we can make them blink or glow in different patterns. It's a fun way to learn about electronics and coding while making something eye-catching. So let's dive in and see what kind of cool patterns we can create.

Supplies

Screenshot 2024-04-09 181002.png
Screenshot 2024-04-09 180824.png
Screenshot 2024-04-09 180854.png
Screenshot 2024-04-10 175348.png
Screenshot 2024-04-09 181133.png
  1. STM32F401CE
  2. LED 3V
  3. Jumper wires M-F
  4. C-type Cable
  5. Breadboard

Create New File in STM32cubeIDE

Screenshot 2024-03-12 150750.png

Open STM32cubeIDE>>file>>New>>STM32project.

Configure Your STMcubeIDE

Screenshot 2024-03-12 151107.png

Select your stm board, after selecting rename it.

PIN Mode Selection & Pinout Configuration

Screenshot 2024-04-10 180442.png

set the pin c13,14,15 for GPIO_output.

For Pinout configuration follow below steps.

System core>>RCC>>High speed clock(HSE)>>Crystal/ceramic Resonator.

Clock Configuration

Screenshot 2024-04-10 180519.png

For Clock Configuration fill the Columns shown in picture.

Open New Code File

Screenshot 2024-04-09 184535.png

Now press ctrl+s to open codding file, After this the new code file will open.

Add the Code

Screenshot 2024-04-10 181844.png

HAL_GPIO_WritePin(GPIOC,GPIO_PIN_13,0);

   HAL_GPIO_WritePin(GPIOC,GPIO_PIN_14,0);

   HAL_GPIO_WritePin(GPIOC,GPIO_PIN_15,0);

   HAL_Delay(400);

   HAL_GPIO_WritePin(GPIOC,GPIO_PIN_13,0);

     HAL_GPIO_WritePin(GPIOC,GPIO_PIN_14,0);

     HAL_GPIO_WritePin(GPIOC,GPIO_PIN_15,1);

     HAL_Delay(400);

     HAL_GPIO_WritePin(GPIOC,GPIO_PIN_13,0);

      HAL_GPIO_WritePin(GPIOC,GPIO_PIN_14,1);

      HAL_GPIO_WritePin(GPIOC,GPIO_PIN_15,0);

      HAL_Delay(400);

      HAL_GPIO_WritePin(GPIOC,GPIO_PIN_13,0);

        HAL_GPIO_WritePin(GPIOC,GPIO_PIN_14,1);

        HAL_GPIO_WritePin(GPIOC,GPIO_PIN_15,1);

        HAL_Delay(400);

        HAL_GPIO_WritePin(GPIOC,GPIO_PIN_13,1);

         HAL_GPIO_WritePin(GPIOC,GPIO_PIN_14,0);

         HAL_GPIO_WritePin(GPIOC,GPIO_PIN_15,0);

         HAL_Delay(400);

         HAL_GPIO_WritePin(GPIOC,GPIO_PIN_13,1);

           HAL_GPIO_WritePin(GPIOC,GPIO_PIN_14,0);

           HAL_GPIO_WritePin(GPIOC,GPIO_PIN_15,1);

           HAL_Delay(400);

           HAL_GPIO_WritePin(GPIOC,GPIO_PIN_13,1);

            HAL_GPIO_WritePin(GPIOC,GPIO_PIN_14,1);

            HAL_GPIO_WritePin(GPIOC,GPIO_PIN_15,0);

            HAL_Delay(400);

            HAL_GPIO_WritePin(GPIOC,GPIO_PIN_13,1);

              HAL_GPIO_WritePin(GPIOC,GPIO_PIN_14,1);

              HAL_GPIO_WritePin(GPIOC,GPIO_PIN_15,1);

              HAL_Delay(400);

Write this given code in While Loop.

Build Binary File

Screenshot 2024-03-12 160000.png

Click on debug (On top left corner) to build a new binary file.

Open STMCubeProgrammer and Connect With STM Board Via USB

Screenshot 2024-04-09 185612.png

Change ST-Link to USB and click on 'Connect'.

Go to Download Options

Screenshot 2024-03-12 160543.png

Modify Download Options and Click on "Start Automatic Mode

Screenshot 2024-04-09 190221.png

Final Step

Screenshot 2024-04-10 182705.png