THREE LED PATTERN USING BREADBOARD
by Arshdeep singh in Circuits > Electronics
79 Views, 0 Favorites, 0 Comments
THREE LED PATTERN USING BREADBOARD
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
- STM32F401CE
- LED 3V
- Jumper wires M-F
- C-type Cable
- Breadboard
Create New File in STM32cubeIDE
Open STM32cubeIDE>>file>>New>>STM32project.
Configure Your STMcubeIDE
Select your stm board, after selecting rename it.
PIN Mode Selection & Pinout Configuration
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
For Clock Configuration fill the Columns shown in picture.
Open New Code File
Now press ctrl+s to open codding file, After this the new code file will open.
Add the Code
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
Click on debug (On top left corner) to build a new binary file.
Open STMCubeProgrammer and Connect With STM Board Via USB
Change ST-Link to USB and click on 'Connect'.