HomeACcessoryKid / ESP8266-HomeKit-Demo

User part of the ESP8266-HomeKit foundation
https://www.youtube.com/watch?v=Xnr-utWDIR8
Apache License 2.0
125 stars 27 forks source link

At button led, I changed GPIO 0, but it didn't work #14

Closed lou-lan closed 7 years ago

lou-lan commented 7 years ago

At button led, I changed GPIO 0, but it didn't work.

My code is like this, I changed GPIO0 to GPIO5

gpio0_in_cfg.GPIO_IntrType = GPIO_PIN_INTR_NEGEDGE;         //Falling edge trigger
gpio0_in_cfg.GPIO_Mode     = GPIO_Mode_Input;               //Input mode
gpio0_in_cfg.GPIO_Pin      = GPIO_Pin_5;                    //Enable GPIO
gpio_config(&gpio0_in_cfg);                                 //Initialization function
gpio_intr_callbacks[5]=led_intr;                           //define the Pin0 callback
AdySan commented 7 years ago

Are you aware that GPIO0 is special in some ways. Check how it is wired on your board.

http://www.instructables.com/id/ESP8266-Using-GPIO0-GPIO2-as-inputs/

On Wed, May 24, 2017 at 1:58 AM, 楼兰 notifications@github.com wrote:

At button led, I changed GPIO 0, but it didn't work.

My code is like this, I changed GPIO0 to GPIO5

gpio0_in_cfg.GPIO_IntrType = GPIO_PIN_INTR_NEGEDGE; //Falling edge trigger gpio0_in_cfg.GPIO_Mode = GPIO_Mode_Input; //Input mode gpio0_in_cfg.GPIO_Pin = GPIO_Pin_5; //Enable GPIO gpio_config(&gpio0_in_cfg); //Initialization function gpio_intr_callbacks[5]=led_intr; //define the Pin0 callback

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/HomeACcessoryKid/ESP8266-HomeKit-Demo/issues/14, or mute the thread https://github.com/notifications/unsubscribe-auth/AAtdaspGeb86_IITJNWshovRF7S6SNewks5r8_EpgaJpZM4NkzFX .

lou-lan commented 7 years ago

Thanks very much!