improved calc program
This commit is contained in:
24
Calc2/Core/Src/breadboard.c
Normal file
24
Calc2/Core/Src/breadboard.c
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* 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
|
||||
}
|
||||
Reference in New Issue
Block a user