Thanks in advance.
Code: Select all
void pin_setup()
{
/////////////////////////////////////////////////////////////////////
//Pin definition on ESP DOIT Devkit V1 and pin config
//D1 - Red lane Dog 1 Fault light
gpio_config_t io_conf1;
io_conf1.intr_type = GPIO_INTR_DISABLE;//disable interrupt
io_conf1.mode = GPIO_MODE_OUTPUT;//set as output mode
io_conf1.pin_bit_mask = (1ULL<<1);//bit mask of the pins that you want to set,e.g. GPIO 1
io_conf1.pull_down_en = GPIO_PULLDOWN_ENABLE;//enable pull-down mode
io_conf1.pull_up_en = GPIO_PULLUP_DISABLE;//disable pull-up mode
esp_err_t error=gpio_config(&io_conf1);//configure GPIO with the given settings
if(error!=ESP_OK){
printf("error configuring GPIO1 \n");
}
gpio_set_direction(GPIO_NUM_1, GPIO_MODE_OUTPUT);
#define RED_FAULT_1 GPIO_NUM_1
//more code beyond this but cut it for simplicity of post
}