{"id":23045386,"url":"https://github.com/mykeels/readlines","last_synced_at":"2025-08-26T07:06:28.335Z","repository":{"id":93602173,"uuid":"174320288","full_name":"mykeels/ReadLines","owner":"mykeels","description":"An Arduino Library for reading a file, line by line","archived":false,"fork":false,"pushed_at":"2019-05-30T11:13:53.000Z","size":8,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T03:11:13.643Z","etag":null,"topics":["arduino","c","callbacks","cpp","files","readline","sd"],"latest_commit_sha":null,"homepage":null,"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/mykeels.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}},"created_at":"2019-03-07T10:10:06.000Z","updated_at":"2024-07-11T17:42:08.000Z","dependencies_parsed_at":"2023-03-10T14:15:43.283Z","dependency_job_id":null,"html_url":"https://github.com/mykeels/ReadLines","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mykeels/ReadLines","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mykeels%2FReadLines","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mykeels%2FReadLines/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mykeels%2FReadLines/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mykeels%2FReadLines/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mykeels","download_url":"https://codeload.github.com/mykeels/ReadLines/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mykeels%2FReadLines/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264324566,"owners_count":23590899,"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","c","callbacks","cpp","files","readline","sd"],"created_at":"2024-12-15T21:20:03.107Z","updated_at":"2025-07-08T18:35:39.858Z","avatar_url":"https://github.com/mykeels.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ReadLines\n\nAn Arduino library for reading a file, line by line, from an SD card.\n\n## Supported Boards\n\nThis library does not contain board-specific code, but it only been tested on\n\n- [ESP8266 with Micro SD Card adapter](https://www.instructables.com/id/SD-Card-Module-With-ESP8266/)\n\nIf you have used it successfully on a different board, please indicate, so this list can be updated.\n\n## Usage with inline callback function\n\n```cpp\n#include \u003cSPI.h\u003e\n#include \u003cSD.h\u003e\n#include \u003cReadLines.h\u003e\n\nchar line1[RL_MAX_CHARS];\n\nvoid setup() {\n    Serial.begin(9600);\n\n    while (!SD.begin(D8)) {\n        Serial.println(\"initialization failed!\");\n        delay(1000);\n    }\n}\n\nvoid loop() {\n    RL.readLines(\"sample-file.txt\", [](char* line, int index) {\n        Serial.println(String(line) + \" \" + String(index));\n    });\n}\n```\n\n## Usage with pre-declared callback function\n\n```cpp\n/** add above setup code here */\n\nvoid loop() {\n    RL.readLines(\"sample-file.txt\", \u0026handleEachLine);\n}\n\nvoid handleEachLine(char line[], int lineIndex) {\n    Serial.println(String(line) + \" \" + String(index));\n}\n```\n\n## Usage (Method Overrides)\n\nYou may omit the 2nd argument `int lineIndex` in the `RL.readLines` callback function, so the definition for `handleEachLine` becomes:\n\n```cpp\nvoid handleEachLine(char line[]) {\n    Serial.println(String(line));\n}\n```\n\nYou may also pass in `File` object as the 1st argument in the `RL.readLines` callback function, like:\n\n```cpp\nvoid loop() {\n    File txtFile = SD.open(\"setup.txt\");\n    RL.readLines(txtFile, \u0026handleEachLine);\n    txtFile.close();\n}\n\nvoid handleEachLine(char line[]) {\n    Serial.println(String(line));\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmykeels%2Freadlines","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmykeels%2Freadlines","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmykeels%2Freadlines/lists"}