/**
 ******************************************************************************
 * @file           : main.c
 * @author         : Auto-generated by STM32CubeIDE
 * @brief          : Main program body
 ******************************************************************************
 * @attention
 *
 * Copyright (c) 2024 STMicroelectronics.
 * All rights reserved.
 *
 * This software is licensed under terms that can be found in the LICENSE file
 * in the root directory of this software component.
 * If no LICENSE file comes with this software, it is provided AS-IS.
 *
 ******************************************************************************
 */

#include <stdint.h>
#include "STM32F103IO.h"
#include "Keypad.h"
#include "LCD1602.h"


#if !defined(__SOFT_FP__) && defined(__ARM_FP)
  #warning "FPU is not initialized, but the project is compiling for an FPU. Please initialize the FPU before use."
#endif





int main(void)
{
	volatile char key;

	keypad_Init();
	LCD_Init();

	LCD_Clear();                   // Clear the LCD
	LCD_Cursor(0, 5);              // Set the cursor at 1st row, 6th column
	LCD_String("Keypad");
	LCD_Cursor(1, 0);              // Set the cursor at 2nd row, 1st column

	while(1){
		key = keypad();
		if(key){
			LCD_Char(key);              // Print the character into LCD
		  delay_ms(700);              // Keypad debouncing delaly
		}
	}
}
Loading
stm32-bluepill