Open Maxmudjon opened 7 years ago
please see how the led gets SET by the timer. Create an integer cJSON object and treat it in a similar way.
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);
}
}
yes
How to set value ?