Files
STMRepo/Calc2/Core/Src/breadboard.c
2025-09-12 08:47:43 -05:00

25 lines
506 B
C

/*
* breadboard.c
*
* Created on: Sep 12, 2025
* Author: ja
*/
#include <stdbool.h>
#include "main.h"
void
breadboard(int DELAY_MS)
{
bool Purple = (HAL_GPIO_ReadPin(GPIOE, BTN_PRPL_Pin) == GPIO_PIN_SET);
bool Grey = (HAL_GPIO_ReadPin(GPIOE, BTN_GREY_Pin) == GPIO_PIN_SET);
if (Purple && Grey) {
HAL_GPIO_WritePin(GPIOA, LED_EXT_Pin, GPIO_PIN_SET);
} else {
HAL_GPIO_WritePin(GPIOA, LED_EXT_Pin, GPIO_PIN_RESET);
}
HAL_Delay(DELAY_MS); // milliseconds of delay after execution
}