Light Up Your World: Blinking LED(External) With STM32F401CE

by Tushar_Garg in Circuits > Microcontrollers

38 Views, 0 Favorites, 0 Comments

Light Up Your World: Blinking LED(External) With STM32F401CE

1.jpeg

Get started with embedded systems by blinking an LED with the STM32F401CE! This powerful microcontroller is a great gateway to the world of electronics projects. We'll use STM32CubeMX's Hardware Abstraction Layer (HAL) to control an external LED and make it blink.

Supplies

  1. STM32F401CE
  2. LED 3V
  3. Jumper wires M-F
  4. C-type Cable

Create New File in STM32cubeID

1.png

Navigate to Your Project:

  • Open the project where you want to create the new file.
  • You can either create a new project or use an existing one.

Create a New File:

  • Right-click on the folder or directory where you want to add the new file.
  • Select New > File from the context menu.


Now Configure Your STMcubeIDE

2.png

Selection of Modes for Pins

3.png

Pinout & Clock Configuration

4.1.png

Add Code

HAL_GPIO_WritePin(GPIOC,GPIO_PIN_14,1);

  HAL_Delay(1000);

  HAL_GPIO_WritePin(GPIOC,GPIO_PIN_14,0);

  HAL_Delay(1000);

write this code in while loop.

Build Binary File

7.png

Connect STM32 Using USB

6.png

Click on Download Option

11.png

Select Start Automatic Mode

7.png