mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-12-04 19:08:19 +00:00
ESP IDF Robot
This commit is contained in:
@@ -130,6 +130,7 @@ void app_main(void)
|
||||
/* Configure the peripheral according to the LED type */
|
||||
//configure_led();
|
||||
|
||||
// Configure on-board LED
|
||||
io_conf.intr_type = GPIO_INTR_DISABLE;
|
||||
io_conf.mode = GPIO_MODE_OUTPUT;
|
||||
io_conf.pin_bit_mask = GPIO_OUTPUT_PIN_SEL;
|
||||
@@ -137,13 +138,14 @@ void app_main(void)
|
||||
io_conf.pull_up_en = 0;
|
||||
gpio_config(&io_conf);
|
||||
|
||||
// Configure on-board push button
|
||||
io_conf.intr_type = GPIO_INTR_POSEDGE;
|
||||
io_conf.pin_bit_mask = GPIO_INPUT_PIN_SEL;
|
||||
io_conf.mode = GPIO_MODE_INPUT;
|
||||
io_conf.pull_up_en = 1;
|
||||
gpio_config(&io_conf);
|
||||
|
||||
// Set pin interrupt
|
||||
// Set push button interrupt
|
||||
gpio_set_intr_type(PUSH_BTN_GPIO, GPIO_INTR_NEGEDGE);//ANYEDGE);
|
||||
gpio_evt_queue = xQueueCreate(10, sizeof(uint32_t));
|
||||
xTaskCreate(gpio_task, "GPIO task", 2048, NULL, 10, NULL);
|
||||
|
||||
Reference in New Issue
Block a user