ESP8266-HomeKit-Demo icon indicating copy to clipboard operation
ESP8266-HomeKit-Demo copied to clipboard

Temperature sensor

Open Maxmudjon opened this issue 6 years ago • 3 comments

How to set value ?

Maxmudjon avatar Oct 16 '17 15:10 Maxmudjon

please see how the led gets SET by the timer. Create an integer cJSON object and treat it in a similar way.

HomeACcessoryKid avatar Oct 16 '17 18:10 HomeACcessoryKid

here ?

void led_intr() { int new; static uint32 oldtime;

if ( (oldtime+200)<(oldtime=(system_get_time()/1000) ) ) {  //200ms debounce guard
    new=GPIO_INPUT(GPIO_Pin_2)^1; //get new state
    GPIO_OUTPUT(GPIO_Pin_2,new);       //toggle
    gpio2.value->type=42;
    change_value(    gpio2.aid,gpio2.iid,gpio2.value);
    send_events(NULL,gpio2.aid,gpio2.iid);
}

}

Maxmudjon avatar Oct 16 '17 19:10 Maxmudjon

yes

HomeACcessoryKid avatar Oct 21 '17 16:10 HomeACcessoryKid