Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temperature sensor #30

Open
Maxmudjon opened this issue Oct 16, 2017 · 3 comments
Open

Temperature sensor #30

Maxmudjon opened this issue Oct 16, 2017 · 3 comments

Comments

@Maxmudjon
Copy link

How to set value ?

@HomeACcessoryKid
Copy link
Owner

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

@Maxmudjon
Copy link
Author

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);
}

}

Repository owner deleted a comment from Maxmudjon Oct 21, 2017
@HomeACcessoryKid
Copy link
Owner

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants