Aim: To Interface a Digital Input (userpush button ) to ARM development board and write a program to obtain the data and flash the led
The full form of an ARM is an advanced reduced instruction set computer (RISC) machine, and it is a 32-bit processor architecture expanded by ARM holdings. The applications of an ARM processor include several microcontrollers as well as processors. The architecture of an ARM processor was licensed by many corporations for designing ARM processor-based SoC products and CPUs. This allows the corporations to manufacture their products using ARM architecture. Likewise, all main semiconductor companies will make ARM-based SOCs such as Samsung, Atmel, TI etc.
-
select the target to be programmed as shown below and click on next
6.select the appropriate pins as gipo, in or out, USART or required options and configure
7.click on cntrl+S , automaticall C program will be generated
8. edit the program and as per required
-
connect the ARM board to power supply and usb
-
check for execution of the output using run option
Developed by : Divakar R
Register number : 212222240026
#include "main.h"
#include "stdbool.h"
bool button_status;
void push_button();
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
while (1)
{
push_button();
}
}
void push_button()
{
button_status=HAL_GPIO_ReadPin(GPIOC,GPIO_PIN_13);
if(button_status==0)
{
HAL_GPIO_WritePin(GPIOA,GPIO_PIN_5,SET);
HAL_Delay(50);
HAL_GPIO_WritePin(GPIOA,GPIO_PIN_5,RESET);
HAL_Delay(50);
}
else
{
HAL_GPIO_WritePin(GPIOA,GPIO_PIN_5,RESET);
}
}
Interfacing a digital Input (Pushbutton ) with ARM microcontroller based IOT development is executed and the results are verified.