I've been scratching my head over the past few hours and stumped. I didn't think it would be this trivial and wondered if anyone else was encountering the same problem. I am down to the basics and still can't get it to work.
Code: Select all
static void i2c_0_task( void *pvParameters ) {
// initialize the xLastWakeTime variable with the current time.
TickType_t xLastWakeTime = xTaskGetTickCount ();
//
//
uint8_t gpio_pin = GPIO_NUM_13;
gpio_reset_pin(gpio_pin);
esp_rom_gpio_pad_select_gpio(gpio_pin);
gpio_set_direction(gpio_pin, GPIO_MODE_OUTPUT);
//
// task loop entry point
for ( ;; ) {
if(gpio_get_level(gpio_pin) == 1) {
gpio_set_level(gpio_pin, 0);
} else {
gpio_set_level(gpio_pin, 1);
}
ESP_LOGI(APP_TAG, "GPIO %d: %d", gpio_pin, gpio_get_level(gpio_pin));
//
//
// pause the task per defined wait period
vTaskDelaySecUntil( &xLastWakeTime, 5 );
}
//
// free up task resources and remove task from stack
vTaskDelete( NULL );
}
esp32 pinout reference: https://randomnerdtutorials.com/esp32-p ... nce-gpios/
Any suggestions would be greatly appreciated.