{"action":"created","issue":{"url":"https://api.github.com/repos/lis-epfl/MAVRIC_Library/issues/103","labels_url":"https://api.github.com/repos/lis-epfl/MAVRIC_Library/issues/103/labels{/name}","comments_url":"https://api.github.com/repos/lis-epfl/MAVRIC_Library/issues/103/comments","events_url":"https://api.github.com/repos/lis-epfl/MAVRIC_Library/issues/103/events","html_url":"https://github.com/lis-epfl/MAVRIC_Library/issues/103","id":100067861,"number":103,"title":"Remote control callbacks","user":{"login":"basil-huber","id":4070244,"avatar_url":"https://avatars.githubusercontent.com/u/4070244?v=3","gravatar_id":"","url":"https://api.github.com/users/basil-huber","html_url":"https://github.com/basil-huber","followers_url":"https://api.github.com/users/basil-huber/followers","following_url":"https://api.github.com/users/basil-huber/following{/other_user}","gists_url":"https://api.github.com/users/basil-huber/gists{/gist_id}","starred_url":"https://api.github.com/users/basil-huber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basil-huber/subscriptions","organizations_url":"https://api.github.com/users/basil-huber/orgs","repos_url":"https://api.github.com/users/basil-huber/repos","events_url":"https://api.github.com/users/basil-huber/events{/privacy}","received_events_url":"https://api.github.com/users/basil-huber/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lis-epfl/MAVRIC_Library/labels/Done%20(review%20needed)","name":"Done (review needed)","color":"fef2c0"},{"url":"https://api.github.com/repos/lis-epfl/MAVRIC_Library/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-10T13:35:47Z","updated_at":"2015-08-11T11:05:56Z","closed_at":null,"body":"I propose an easy and clean way to register simple callbacks which are triggered as a remote control button is switched.\r\nIT can be used as follows:\r\nremote_callback_register(remote, my_cb_function, my_structure, remote_channel);\r\nAs the value of remote_channel changes, the function my_cb_function(my_structure, new_value); is called.\r\n\r\nThis allows to register callback without modifying the MAVRIC_Library. Furthermore, it is structured and clean. Furthermore, is \"synchronized\" with remote_update function, which avoids polling to often or not often enough"},"comment":{"url":"https://api.github.com/repos/lis-epfl/MAVRIC_Library/issues/comments/129836151","html_url":"https://github.com/lis-epfl/MAVRIC_Library/issues/103#issuecomment-129836151","issue_url":"https://api.github.com/repos/lis-epfl/MAVRIC_Library/issues/103","id":129836151,"user":{"login":"basil-huber","id":4070244,"avatar_url":"https://avatars.githubusercontent.com/u/4070244?v=3","gravatar_id":"","url":"https://api.github.com/users/basil-huber","html_url":"https://github.com/basil-huber","followers_url":"https://api.github.com/users/basil-huber/followers","following_url":"https://api.github.com/users/basil-huber/following{/other_user}","gists_url":"https://api.github.com/users/basil-huber/gists{/gist_id}","starred_url":"https://api.github.com/users/basil-huber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basil-huber/subscriptions","organizations_url":"https://api.github.com/users/basil-huber/orgs","repos_url":"https://api.github.com/users/basil-huber/repos","events_url":"https://api.github.com/users/basil-huber/events{/privacy}","received_events_url":"https://api.github.com/users/basil-huber/received_events","type":"User","site_admin":false},"created_at":"2015-08-11T11:05:56Z","updated_at":"2015-08-11T11:05:56Z","body":"I added rising/falling edge to the latest commit. However, at the moment the edge direction is not given to the function. Should it be given or should we leave that to the \"user\" ? (since the new value is transmitted, he could store the old value in the struct and compare)\r\n\r\nThere is an issue with the 11bit protocol: there is a tiny jitter on the button values (I have never seen the raw value to vary more than +/-1). If it really varies only between +/-1, than I will add that the change should be larger than 1. If it can be more, we could either define a common epsilon for all callbacks or let the \"user\" define an epsilon for each callback."}}