shaurya jain
Published

THREE LED'S Blink in various combination

Blinking Three LEDs in various combination using stm32F401CCU6 and STM32 CubeIDE

AdvancedFull instructions provided1 hour4
THREE LED'S Blink in various combination

Things used in this project

Hardware components

LED (generic)
LED (generic)
×1
STM 32 F401CCU6
×1

Story

Read more

Code

THREE LEDS BLINKING IN Various combination

C/C++
#include "main.h"

void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);

int main(void)
{
  HAL_Init();
  SystemClock_Config();
  MX_GPIO_Init();

  while (1)
  {
    // Pattern 100
    HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5, GPIO_PIN_SET);
    HAL_GPIO_WritePin(GPIOA, GPIO_PIN_6 | GPIO_PIN_7, GPIO_PIN_RESET);
    HAL_Delay(500); // Delay 500 ms

    // Add other patterns here following the same structure
    // ...

    // Pattern 110
    HAL_GPIO_WritePin(GPIOA, GPIO_PIN_5 | GPIO_PIN_6, GPIO_PIN_SET);
    HAL_GPIO_WritePin(GPIOA, GPIO_PIN_7, GPIO_PIN_RESET);
    HAL_Delay(500); // Delay 500 ms
  }
}

Credits

shaurya jain

shaurya jain

2 projects • 0 followers

Comments