Skip to content

art-of-electronics/stm32_button_routines

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stm32_button_routines

Routines for handling buttons done the right way :)

If you ever struggled with handling buttons in your MCU project - struggle no more. Here is a good example of button routines for STM32 microcontrollers coded with HAL and LL in CubeMX IDE.

No interrupt nor lame 20ms delay "debounce".

The code includes non-blocking routines for following button events:

  • pressing button
  • pressing and releasing button

Use as many buttons as you wish, as long as you have enough GPIO_Inputs in your MCU!

Schematic for connecting button (and LED)

If you're short on space on PCB, you can use internall pull-up for button and ommit external resistors.

Content:

  • F103_Buttons_HAL - example with HAL library made on popular "bluepill" STM32F103;
  • F103_Buttons_LL - example with LL library made on popular "bluepill" STM32F103;
  • HAL - source and header files made with HAL;
  • LL - source and header files made with LL;

About

Routines for handling buttons done the right way :)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published