Hi,
How to detect if some pin is short-circuited? I tried to google `esp idf short circuit` but got nothing useful. Could you please give me some guidance? documents, links, etc.
Thank you
How to detect short circuit?
-
- Posts: 54
- Joined: Mon Dec 05, 2016 12:34 am
Re: How to detect short circuit?
Code: Select all
void initialise() {
gpio_pad_select_gpio(PIN_NUM);
gpio_set_direction(PIN_NUM, GPIO_MODE_INPUT);
gpio_set_pull_mode(PIN_NUM, GPIO_PULLUP_ONLY);
xTaskCreatePinnedToCore(&task, "task", 2048, NULL, TASK_PRIORITY, NULL, TASK_CORE_ID);
}
void task(void *pvParameters) {
TickType_t xLastWakeTime = xTaskGetTickCount();
while (1) {
if (gpio_get_level(PIN_NUM) == 0) {
// ...
}
vTaskDelayUntil(&xLastWakeTime, 50 / portTICK_RATE_MS);
}
}
Who is online
Users browsing this forum: No registered users and 262 guests