{"id":26504667,"url":"https://github.com/lbirkert/asyncino","last_synced_at":"2026-05-21T14:05:28.192Z","repository":{"id":197419070,"uuid":"698622764","full_name":"lbirkert/asyncino","owner":"lbirkert","description":"An asynchronous library for the Arduino family","archived":false,"fork":false,"pushed_at":"2023-10-02T06:10:18.000Z","size":42,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-16T14:20:23.995Z","etag":null,"topics":["arduino","async","iot"],"latest_commit_sha":null,"homepage":"https://www.arduino.cc/reference/en/libraries/asyncino/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lbirkert.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}},"created_at":"2023-09-30T13:19:31.000Z","updated_at":"2023-10-01T13:47:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"d6c25ba7-b65a-45bf-bfdc-0d8ad7b06d42","html_url":"https://github.com/lbirkert/asyncino","commit_stats":null,"previous_names":["lbirkert/asyncino"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbirkert%2Fasyncino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbirkert%2Fasyncino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbirkert%2Fasyncino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lbirkert%2Fasyncino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lbirkert","download_url":"https://codeload.github.com/lbirkert/asyncino/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244683418,"owners_count":20493184,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["arduino","async","iot"],"created_at":"2025-03-20T20:12:46.844Z","updated_at":"2026-05-21T14:05:28.161Z","avatar_url":"https://github.com/lbirkert.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![.github/workflows/lint.yaml](https://github.com/lbirkert/asyncino/actions/workflows/lint.yaml/badge.svg)](https://github.com/lbirkert/asyncino/actions/workflows/lint.yaml)\n\n```\n                               _\n  ____ ________  ______  _____(_)___  ____\n / __ `/ ___/ / / / __ \\/ ___/ / __ \\/ __ \\\n/ /_/ (__  ) /_/ / / / / /__/ / / / / /_/ /\n\\__,_/____/\\__, /_/ /_/\\___/_/_/ /_/\\____/\n          /____/\n```\n\nAn asynchronous library for the Arduino family. [Examples](https://github.com/lbirkert/asyncino/tree/main/examples)\n\n----\n\n\u003cbr/\u003e\n\n## Feature ASYNCINO_DELAY\n\nEnables the usage of the asynchronous `delay(callback, milliseconds)` and\n`delayMicroseconds(callback, microseconds)` functions.\n\n### Arduino Reference\n\nhttps://www.arduino.cc/reference/en/language/functions/time/delay/ \u003cbr/\u003e\nhttps://www.arduino.cc/reference/en/language/functions/time/delaymicroseconds/\n\n### Settings\n\n`ASYNCINO_DELAY_POOL`: the maximum amount of concurrent delays. (default: `1`)\n\n### Usage\n\n```ino\n#define ASYNCINO_DELAY\n\n#include \"asyncino.h\"\n\nvoid setup() {\n    Serial.println(\"Hello World\");\n\n    delay([]() {\n        Serial.println(\"1s later: Hello World\");\n        delay([]() {\n            Serial.println(\"1.5s later: Hello World\");\n        }, 500);\n    }, 1000);\n    \n    delay([]() {\n        Serial.println(\"0.5s later: Hello World\");\n    }, 500);\n}\n\nvoid loop() {\n    asyncino();\n}\n```\n\n----\n\n\u003cbr/\u003e\n\n## Feature ASYNCINO_PULSEIN\n\nEnables the usage of the asynchonous `pulseIn(callback, port, value, timeout?)` and\n`pulseInLong(callback, port, value, timeout?)` functions.\n\n### Arduino Reference\n\nhttps://www.arduino.cc/reference/en/language/functions/advanced-io/pulsein/ \u003cbr/\u003e\nhttps://www.arduino.cc/reference/en/language/functions/advanced-io/pulseinlong/\n\n### Settings\n\n`ASYNCINO_PULSEIN_POOL`: the maximum amount of concurrent pulseIns. (default: `1`)\n\n### Usage\n\n```ino\n#define ASYNCINO_PULSEIN\n\n#include \"asyncino.h\"\n\nvoid setup() {\n    pinMode(7, INPUT_PULLUP);\n    // waits for pulse (HIGH =\u003e LOW: start timer, LOW =\u003e HIGH: stop timer)\n    pulseIn([](unsigned long duration) {\n        Serial.println(\"pin 7 received a pulse: \" + String(duration) + \"us\");\n    }, 7, LOW);\n}\n\nvoid loop() {\n    asyncino();\n}\n```\n\n----\n\n\u003cbr/\u003e\n\n## Feature ASYNCINO_ID\n\nEnables the usage of ids, which can be used to clear delays and pulseIns. (`clearDelay(id)`, `clearPulseIn(id)`)\n\n### Settings\n\n`ASYNCINO_ID_POOL`: the size of the free id ring buffer. (default: `ASYNCINO_PULSEIN_POOL + ASYNCINO_DELAY_POOL`)\n\n### Usage\n\n```ino\n#define ASYNCINO_ID\n#define ASYNCINO_DELAY\n\n#include \"asyncino.h\"\n\nvoid setup() {\n    const AId myDelay = delay([]() {\n        Serial.println(\"MyDelay was executed\"); // This should not be printed\n    }, 2000);\n\n    delay([]() {\n        Serial.println(\"MyDelay was cleared\");\n        clearDelay(myDelay); // Cancels a pending delay\n    }, 1000);\n}\n\nvoid loop() {\n    asyncino();\n}\n```\n\n----\n\n\u003cbr/\u003e\n\n## Feature ASYNCINO_LISTEN\n\nEnables the usage of `listen(cb, port, type)`, which can be used to listen for certain changes on a pin.\n\ntype can be one of the following:\n\n|value | constant | description|\n|--|--|--|\n|0|`ALISTEN_LOW`| run cb whenever pin is LOW|\n|1|`ALISTEN_HIGH`| run cb whenever pin is HIGH|\n|2|`ALISTEN_FALLING`| run cb whenever pin goes from HIGH to LOW|\n|3|`ALISTEN_RISING`| run cb whenever pin goes from LOW to HIGH|\n|4|`ALISTEN_CHANGE`| run cb whenever pin value changes (RISING or FALLING)|\n\n### Settings\n\n`ASYNCINO_LISTEN_POOL`: the maximum amount of concurrent listens. (default: `1`)\n\n### Usage\n\n```ino\n#define ASYNCINO_LISTEN\n\n#include \"asyncino.h\"\n\nvoid setup() {\n    pinMode(7, INPUT_PULLUP);\n\n    // watch pin 7 for changes\n    listen([](int value) {\n        Serial.println(\"PIN CHANGED: \" + String(value));\n    }, 7, ALISTEN_CHANGE); \n}\n\nvoid loop() {\n    asyncino();\n}\n```\n\n----\n\n\u003cbr/\u003e\n\n\u0026copy; Copyright 2023 [Lucas Birkert](https://lbirkert.com), all rights reserved\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flbirkert%2Fasyncino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flbirkert%2Fasyncino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flbirkert%2Fasyncino/lists"}