{"id":26606852,"url":"https://github.com/eagletrt/libblinky-sw","last_synced_at":"2026-05-18T06:03:13.067Z","repository":{"id":283895941,"uuid":"952569181","full_name":"eagletrt/libblinky-sw","owner":"eagletrt","description":"Library to handle a blinking pattern without using hardware timers suited for all embedded devices","archived":false,"fork":false,"pushed_at":"2026-03-09T17:48:38.000Z","size":102,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-09T22:54:14.923Z","etag":null,"topics":["embedded","led-controller","library","platformio","platformio-library","sw"],"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/eagletrt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-21T13:55:40.000Z","updated_at":"2026-03-09T17:48:44.000Z","dependencies_parsed_at":"2025-03-22T22:22:31.176Z","dependency_job_id":"e0d4ae8f-7b3c-4b77-a9df-8d84193a4ed2","html_url":"https://github.com/eagletrt/libblinky-sw","commit_stats":null,"previous_names":["eagletrt/libblinky-sw"],"tags_count":1,"template":false,"template_full_name":"eagletrt/libstm32-sw-template","purl":"pkg:github/eagletrt/libblinky-sw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eagletrt%2Flibblinky-sw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eagletrt%2Flibblinky-sw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eagletrt%2Flibblinky-sw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eagletrt%2Flibblinky-sw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eagletrt","download_url":"https://codeload.github.com/eagletrt/libblinky-sw/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eagletrt%2Flibblinky-sw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33167430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T05:43:36.989Z","status":"ssl_error","status_checked_at":"2026-05-18T05:43:19.133Z","response_time":71,"last_error":"SSL_read: 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":["embedded","led-controller","library","platformio","platformio-library","sw"],"created_at":"2025-03-23T22:23:41.328Z","updated_at":"2026-05-18T06:03:13.055Z","avatar_url":"https://github.com/eagletrt.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LIBBLINKY\n\nThis *light* library can be used to blink a digital LED following a custom pattern\nwithout using a timer or blocking code.\n\n\u003e [!NOTE]\n\u003e This library does not actually blink the led directly but it manage its state internally\n\n## Usage\n\nTo use this library first declare a new `Blinky` handler and initialize it with the\n`blinky_init` function as follows:\n```c\nstruct Blinky blinker;\nblinky_api_init(\u0026blinker, pattern, PATTERN_SIZE, true, BLINKY_LOW);\n```\n\nThe init function requires a pattern with its length, the option to repeat it or run it once\nand the initial state of the led.\n\nTo update the led status you need to call the `blinky_routine` function and set the actual\nled status accordingly as follows:\n```c\nenum BlinkyState led_status = blinky_api_routine(\u0026blinker, current_time);\nset_led_status(led_status);\n```\nwhere the `current_time` is the time that the blinker library uses to check the led state\nand the `set_led_status` function has to be implemented by the user (or substituted with\nan equivalent function)\n\n\u003e [!NOTE]\n\u003e The provided time defines the unit of measurement of the pattern (recomended is s or ms)\n\n---\n\nThe pattern is an array of `uint16_t` where each element represent how much time\nthe led should remain in the current state. \\\nThe initial state is set in the init function but can be changed any time.\n\nIf the difference between the current time and the previous saved time is greater than\nthe time specified in the pattern at the current index the state is **toggled** and the\nindex is incremented by one.\n\n\u003e [!NOTE]\n\u003e If the bilnker is set to repeat mode the index wraps around after it reaches the end,\n\u003e otherwise it is just set to `0`\n\nFor example with **HIGH** as initial state and the following pattern: `{ 500, 1000, 500 }`;\nthe led is kept **HIGH** for 500 units of time, then **LOW** for 1000\nand then **HIGH** again for 500. \\\nIf the pattern repeats, the state is reset to the initial state so, in this example,\nafter the led stays **HIGH** for 1000 units of time it stays **HIGH* for another 1000.\n\n## Examples\n\nHere is a complete example using an **STM32 microcontroller** with the **HAL library**:\n\n```c\n#include \u003cstdint.h\u003e\n#include \u003cstdbool.h\u003e\n#include \"blinky.h\"\n\n#define BLINKY_PATTERN_SIZE (4U)\n\nBlinky blinker;\nuint16_t pattern[BLINKY_PATTERN_SIZE] = {\n    500,\n    500,\n    500,\n    500\n};\n\nint main(void) {\n    // Init blinker\n    blinky_init(\u0026blinker, pattern, BLINKY_PATTERN_SIZE, true, BLINKY_LOW);\n\n    while (1) {\n        // Run blinker and update the led\n        BlinkyState led_status = blinky_routine(\u0026blinker, HAL_GetTick());\n        HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, led_status);\n\n        // Do other stuff\n    }\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feagletrt%2Flibblinky-sw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feagletrt%2Flibblinky-sw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feagletrt%2Flibblinky-sw/lists"}