{"id":20671627,"url":"https://github.com/ravensystem/esp-adv-button","last_synced_at":"2026-03-11T21:18:58.598Z","repository":{"id":110172652,"uuid":"201646742","full_name":"RavenSystem/esp-adv-button","owner":"RavenSystem","description":"esp-open-rtos library to use buttons and toggles","archived":false,"fork":false,"pushed_at":"2023-01-20T12:23:13.000Z","size":43,"stargazers_count":2,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-22T08:50:06.828Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RavenSystem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://paypal.me/ravensystem"]}},"created_at":"2019-08-10T15:15:30.000Z","updated_at":"2023-08-21T15:04:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"9d57ac92-7680-4f72-847b-a928aa5e0671","html_url":"https://github.com/RavenSystem/esp-adv-button","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RavenSystem/esp-adv-button","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RavenSystem%2Fesp-adv-button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RavenSystem%2Fesp-adv-button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RavenSystem%2Fesp-adv-button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RavenSystem%2Fesp-adv-button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RavenSystem","download_url":"https://codeload.github.com/RavenSystem/esp-adv-button/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RavenSystem%2Fesp-adv-button/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30401341,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T21:02:20.017Z","status":"ssl_error","status_checked_at":"2026-03-11T20:59:32.667Z","response_time":84,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T20:28:37.328Z","updated_at":"2026-03-11T21:18:58.575Z","avatar_url":"https://github.com/RavenSystem.png","language":"C","funding_links":["https://paypal.me/ravensystem"],"categories":[],"sub_categories":[],"readme":"\u003ca rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc-nd/4.0/\"\u003e\u003cimg alt=\"Creative Commons License\" style=\"border-width:0\" src=\"https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png\" /\u003e\u003c/a\u003e\u003cbr /\u003eThis work is licensed under a \u003ca rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc-nd/4.0/\"\u003eCreative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License\u003c/a\u003e.\n\n# ESP Advanced Button library\n\nLibrary for esp-open-rtos SDK to manage inputs from built-in GPIOs and MCP23017 interfaces.\n\nWhen MCP23017 is used, GPIOs must be declared with this:\n```c\nadv_button_create(GPIO + (MCP_Index * 100), I2C Bus, Inverted, MCP Address);\n```\n\nWhere MCP_Index is the number from `1` to enumerate all MCP boards, in case that several boards are used. \n\nRequirements:\n- Timers Helper: https://github.com/RavenSystem/timers-helper\n- Advanced I2C: https://github.com/RavenSystem/adv-i2c\n\n```c\n/*\n * Advanced Button Manager Example\n *\n * Copyright 2019-2022 José Antonio Jiménez Campos (@RavenSystem)\n *\n */\n\n#include \u003cstdio.h\u003e\n#include \u003cesp/uart.h\u003e\n#include \u003cesp8266.h\u003e\n#include \u003cFreeRTOS.h\u003e\n\n#include \"adv_button.h\"\n\n\n#ifndef BUTTON_GPIO\n#define BUTTON_GPIO     0\n#endif\n\n#ifndef TOGGLE_GPIO\n#define TOGGLE_GPIO     2\n#endif\n\nvoid singlepress_callback(const uint16_t gpio, void *args, const uint8_t param) {\n    printf(\"\u003e\u003e\u003e\u003e\u003e Example button: Single Press function called using GPIO-\u003e%i\\n\", gpio);\n}\n\nvoid doublepress_callback(const uint16_t gpio, void *args, const uint8_t param) {\n    printf(\"\u003e\u003e\u003e\u003e\u003e Example button: Double Press function called using GPIO-\u003e%i\\n\", gpio);\n}\n\nvoid longpress_callback(const uint16_t gpio, void *args, const uint8_t param) {\n    printf(\"\u003e\u003e\u003e\u003e\u003e Example button: Long Press function called using GPIO-\u003e%i\\n\", gpio);\n}\n\nvoid verylongpress_callback(const uint16_t gpio, void *args, const uint8_t param) {\n    printf(\"\u003e\u003e\u003e\u003e\u003e Example button: Very Long Press function called using GPIO-\u003e%i\\n\", gpio);\n}\n\nvoid holdpress_callback(const uint16_t gpio, void *args, const uint8_t param) {\n    printf(\"\u003e\u003e\u003e\u003e\u003e Example button: Hold Press function called using GPIO-\u003e%i\\n\", gpio);\n}\n\nvoid toggle_callback(const uint16_t gpio, void *args, const uint8_t param) {\n    printf(\"\u003e\u003e\u003e\u003e\u003e Example button: Toggle function called using GPIO-\u003e%i\\n\", gpio);\n}\n\nvoid user_init(void) {\n    uart_set_baud(0, 115200);\n    \n    printf(\"\\n\u003e\u003e\u003e\u003e\u003e ADV BUTTON EXAMPLE\\n\\n\");\n    \n    adv_button_set_evaluate_delay(10);\n    \n    adv_button_create(BUTTON_GPIO, true, false, ADV_BUTTON_NORMAL_MODE);\n    \n    adv_button_register_callback_fn(BUTTON_GPIO, singlepress_callback, SINGLEPRESS_TYPE, NULL, 0);\n    adv_button_register_callback_fn(BUTTON_GPIO, doublepress_callback, DOUBLEPRESS_TYPE, NULL, 0);\n    adv_button_register_callback_fn(BUTTON_GPIO, longpress_callback, LONGPRESS_TYPE, NULL, 0);\n    adv_button_register_callback_fn(BUTTON_GPIO, verylongpress_callback, VERYLONGPRESS_TYPE, NULL, 0);\n    adv_button_register_callback_fn(BUTTON_GPIO, holdpress_callback, HOLDPRESS_TYPE, NULL, 0);\n    \n    adv_button_create(TOGGLE_GPIO, true, false, ADV_BUTTON_NORMAL_MODE);\n    adv_button_register_callback_fn(TOGGLE_GPIO, toggle_callback, INVSINGLEPRESS_TYPE, NULL, 0);    // Low\n    adv_button_register_callback_fn(TOGGLE_GPIO, toggle_callback, SINGLEPRESS_TYPE, NULL, 0);       // High\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fravensystem%2Fesp-adv-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fravensystem%2Fesp-adv-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fravensystem%2Fesp-adv-button/lists"}