Advertisement
aperles

button.c

Mar 5th, 2025
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "driver/gpio.h"
  2. #include "button.h"
  3.  
  4. #define GPIO_BUTTON GPIO_NUM_1
  5.  
  6. void button_init(void)
  7. {
  8. gpio_config_t io_conf = {};
  9. io_conf.pin_bit_mask = 1ULL << GPIO_BUTTON;
  10. io_conf.mode = GPIO_MODE_INPUT;
  11. io_conf.pull_up_en = GPIO_PULLUP_ENABLE;
  12. io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
  13. io_conf.intr_type = GPIO_INTR_DISABLE;
  14.  
  15. gpio_config(&io_conf);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement