{"id":20989867,"url":"https://github.com/robtillaart/nibblearray","last_synced_at":"2025-05-14T18:32:16.367Z","repository":{"id":45309159,"uuid":"273958912","full_name":"RobTillaart/nibbleArray","owner":"RobTillaart","description":"Arduino library for a compact array of nibbles (4 bit units)","archived":false,"fork":false,"pushed_at":"2024-04-13T09:16:42.000Z","size":34,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-07T18:27:05.359Z","etag":null,"topics":["arduino","memory","nibble"],"latest_commit_sha":null,"homepage":"","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/RobTillaart.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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},"funding":{"github":"RobTillaart","custom":"https://www.paypal.me/robtillaart"}},"created_at":"2020-06-21T18:10:49.000Z","updated_at":"2023-11-14T18:47:29.000Z","dependencies_parsed_at":"2023-11-14T17:04:37.214Z","dependency_job_id":null,"html_url":"https://github.com/RobTillaart/nibbleArray","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FnibbleArray","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FnibbleArray/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FnibbleArray/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FnibbleArray/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobTillaart","download_url":"https://codeload.github.com/RobTillaart/nibbleArray/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225305755,"owners_count":17453441,"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","memory","nibble"],"created_at":"2024-11-19T06:26:31.799Z","updated_at":"2024-11-19T06:26:32.403Z","avatar_url":"https://github.com/RobTillaart.png","language":"C++","funding_links":["https://github.com/sponsors/RobTillaart","https://www.paypal.me/robtillaart"],"categories":[],"sub_categories":[],"readme":"\n[![Arduino CI](https://github.com/RobTillaart/nibbleArray/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)\n[![Arduino-lint](https://github.com/RobTillaart/nibbleArray/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/nibbleArray/actions/workflows/arduino-lint.yml)\n[![JSON check](https://github.com/RobTillaart/nibbleArray/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/nibbleArray/actions/workflows/jsoncheck.yml)\n[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/nibbleArray.svg)](https://github.com/RobTillaart/nibbleArray/issues)\n\n[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/nibbleArray/blob/master/LICENSE)\n[![GitHub release](https://img.shields.io/github/release/RobTillaart/nibbleArray.svg?maxAge=3600)](https://github.com/RobTillaart/nibbleArray/releases)\n[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/nibbleArray.svg)](https://registry.platformio.org/libraries/robtillaart/nibbleArray)\n\n\n# nibbleArray\n\nArduino library for a compact array of nibbles (4 bit units).\n\n\n## Description\n\nA nibble is a 4 bit element, which can hold a value 0..15 (0..F in HEX). \nIt can be seen as an **uint4_t** type.\n\nThe nibbleArray is an array that stores 2 nibbles in a byte therefore it is \ntwice as small as a normal array.\n\nThe current implementation can hold 510 elements. This is due a limitation of\nthe UNO which can **allocate** max 255 bytes in one **malloc()** call.\n\nThis **NIBBLEARRAY_MAXSIZE** can be defined compile time \"-D NIBBLEARRAY_MAXSIZE\" \nor one can adjust it in the library if other platforms can allocate more memory.\n\n\n#### Related\n\nThe BitArray library is one from a set of three:\n\n- https://github.com/RobTillaart/BitArray for elements of user defined size in bits (values 0 .. 2^n-1).\n- https://github.com/RobTillaart/BoolArray for elements of 1 bit (values 0 .. 1).\n- https://github.com/RobTillaart/nibbleArray for elements of 4 bits or smaller (values 0 .. 15).\n\n\n## Interface\n\n```cpp\n#include \"nibbleArray.h\"\n```\n\n#### Constructor\n\n- **nibbleArray(uint16_t size)** constructor\n- **uint16_t size()** returns the size of the array.\n- **uint16_t memory()** returns the memory used in bytes.\n\n\n#### Base\n\n- **uint8_t set(uint16_t index, uint8_t value)** set a value in the nibbleArray.\nIndex must be in range otherwise 0xFF = NIBBLEARRAY_ERROR_INDEX will be returned.\nIf value \u003e 15 it will be truncated. \n- **uint8_t get(uint16_t index)** get value from the nibbleArray. \nIndex must be in range otherwise 0xFF = NIBBLEARRAY_ERROR_INDEX will be returned.\n- **void clear()** set all elements to 0.\n- **void SetAll(uint8_t value)** set all elements to value (0..15). \nIf value \u003e 15 it will be truncated.\n\n\n## Future\n\n#### Must\n\n- add a begin() function that does the work now done in constructor (0.3.0)\n  - similar to bitArray and BoolArray classes.\n\n#### Should\n\n- align interface with BoolArray and bitArray.\n  - is there some base class?\n  - align error codes.\n- allow larger allocations for non AVR, how?\n  - don't test for size, user responsibility?\n\n#### Could\n\n- implement NIBBLEARRAY_ERROR_VALUE for set and setAll ??\n  - for now user responsibility.\n\n#### Wont\n\n- setAll( f() ) - fill the array by calling a function n times?\n\n\n## Support\n\nIf you appreciate my libraries, you can support the development and maintenance.\nImprove the quality of the libraries by providing issues and Pull Requests, or\ndonate through PayPal or GitHub sponsors.\n\nThank you,\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobtillaart%2Fnibblearray","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobtillaart%2Fnibblearray","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobtillaart%2Fnibblearray/lists"}