{"id":38766838,"url":"https://github.com/blues/note-arduino","last_synced_at":"2026-03-11T05:09:32.816Z","repository":{"id":37901378,"uuid":"173176324","full_name":"blues/note-arduino","owner":"blues","description":"Library and examples for arduino","archived":false,"fork":false,"pushed_at":"2026-03-08T13:55:20.000Z","size":1531,"stargazers_count":19,"open_issues_count":1,"forks_count":10,"subscribers_count":12,"default_branch":"master","last_synced_at":"2026-03-08T17:46:19.344Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blues.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-02-28T19:41:23.000Z","updated_at":"2026-03-08T13:55:24.000Z","dependencies_parsed_at":"2023-12-26T21:05:05.195Z","dependency_job_id":"7cb32151-7f4b-4a71-8319-e69da0c5b231","html_url":"https://github.com/blues/note-arduino","commit_stats":null,"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"purl":"pkg:github/blues/note-arduino","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blues%2Fnote-arduino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blues%2Fnote-arduino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blues%2Fnote-arduino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blues%2Fnote-arduino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blues","download_url":"https://codeload.github.com/blues/note-arduino/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blues%2Fnote-arduino/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30372129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"online","status_checked_at":"2026-03-11T02:00:07.027Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2026-01-17T12:00:39.927Z","updated_at":"2026-03-11T05:09:32.786Z","avatar_url":"https://github.com/blues.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Coverage Status](https://coveralls.io/repos/github/blues/note-arduino/badge.svg?branch=master)](https://coveralls.io/github/blues/note-arduino?branch=master)\n\n# note-arduino\n\nThe note-arduino Arduino library for communicating with the\n[Blues][blues] Notecard via serial or I²C. Includes example sketches in\nthe [examples directory](examples).\n\nThis library allows you to control a Notecard by writing an Arduino sketch in C\nor C++. Your sketch may programmatically configure Notecard and send Notes to\n[Notehub.io][notehub].\n\nThis library is a wrapper around the [note-c library][note-c], which it includes\nas a git subtree.\n\n## Installation\n\n1. Open the Arduino IDE and click **Tools \u003e Manage Libraries...**.\n2. Search for \"Blues\" in the input box and click the \"Install\" button next\n   to the \"Blues Notecard\" result.\n\n   ![](https://wireless.dev/images/guides/first-sensor/arduino/install-library.gif)\n\n3. Create a new sketch and select the Sketch \u003e Include Library \u003e Contributed\nLibraries \u003e Blues Notecard menu option, to add the following include to\nyour sketch:\n\n   ```\n   #include \u003cNotecard.h\u003e\n   ```\n\n## Usage\n\n```cpp\n#include \u003cNotecard.h\u003e\n\n// Create an instance of the Notecard class.\nNotecard notecard;\n```\n\nBoth configuration methods use the `begin()` method, though the parameters\ndiffer depending on your approach.\n\n### Serial Configuration\n\nFor Serial, pass in the Serial object and baud rate.\n\n```cpp\nnotecard.begin(Serial1, 9600);\n```\n\n### I2C Configuration\n\nFor I2C, you may simply call Notecard `begin()` with no parameters.\n\n```cpp\nnotecard.begin();\n```\n\n### Sending Notecard Requests\n\nNotecard requests use bundled `J` json package to allocate a `req`, is a JSON\nobject for the request to which we will then add Request arguments. The\nfunction allocates a `\"req` request structure using malloc() and initializes its\n\"req\" field with the type of request.\n\n```cpp\nJ *req = notecard.newRequest(\"hub.set\");\nJAddStringToObject(req, \"product\", \"com.[mycompany].[myproduct]\");\nJAddStringToObject(req, \"mode\", \"continuous\");\nnotecard.sendRequest(req);\n```\n\n### Reading Notecard Responses\n\nIf you need to read a response from the Notecard, use the `requestAndResponse()`\nmethod and `JGet*` helper methods to read numbers, strings, etc. from the JSON\nresponse.\n\n```cpp\nJ *rsp = notecard.requestAndResponse(notecard.newRequest(\"card.temp\"));\nif (rsp != NULL) {\n   temperature = JGetNumber(rsp, \"value\");\n   notecard.deleteResponse(rsp);\n}\n```\n\n## Documentation\n\nThe documentation for this library can be found\n[here](https://dev.blues.io/tools-and-sdks/arduino-library/).\n\n## Examples\n\nThe [examples](examples/) directory contains examples for using this library\nwith:\n\n- [Notecard Basics](examples/Example1_NotecardBasics/Example1_NotecardBasics.ino)\n- [Performing Periodic Communications](examples/Example2_PeriodicCommunications/Example2_PeriodicCommunications.ino)\n- [Handling inbound requests with polling](examples/Example3_InboundPolling/Example3_InboundPolling.ino)\n- [Handling inbound interrupts](examples/Example4_InboundInterrupts/Example4_InboundInterrupts.ino)\n- [Using Note templates](examples/Example5_UsingTemplates/Example5_UsingTemplates.ino)\n- [Sensor tutorial](examples/Example6_SensorTutorial/Example6_SensorTutorial.ino)\n- [Power control](examples/Example7_PowerControl/Example7_PowerControl.ino)\n\nBefore running an example, you will need to set the Product Identifier, either\nin code or on your connected Notecard. Steps on how to do this can be found at\n[https://dev.blues.io/tools-and-sdks/samples/product-uid](https://dev.blues.io/tools-and-sdks/samples/product-uid).\n\n\n## Contributing\n\nWe love issues, fixes, and pull requests from everyone. Please run the\nunit-tests ([as described in the following section](#note-arduino-tests)), prior\nto submitting your PR. By participating in this project, you agree to abide by\nthe Blues Inc [code of conduct].\n\nFor details on contributions we accept and the process for contributing, see our\n[contribution guide](CONTRIBUTING.md).\n\n## Note Arduino Tests\n\n### Dependencies\n\nThe tests are designed to be executed using Docker, and the environment required\nby the tests is defined in .github/actions/run-tests-in-container/Dockerfile.\nThe following directions are provided to aid in executing the tests in\na container.\n\n\u003e _**NOTE:** If you are uncomfortable using Docker, then you may wish to use\nthe Dockerfile as a guide to install the necessary dependencies and execute\n`run_all_tests.sh` locally._\n\n### Invocation\n\n1. From the `note-arduino` folder, build the container with the\nfollowing command:\n\n```none\ndocker build .github/actions/run-tests-in-container/ --tag note-arduino-test\n```\n\n1. Execute the tests inside the container using the following command:\n\n```none\ndocker run --rm --volume $(pwd):/note-arduino/ --workdir /note-arduino/ note-arduino-test\n```\n\n1. Similar test results should print to your terminal for review.\n\n### Success\n\nUpon success, you will see a message similar to the following:\n\n```none\n...\n[passed] test_noteserial_arduino_transmit_invokes_hardware_serial_flush_when_flush_parameter_is_true\n[passed] test_noteserial_arduino_transmit_does_not_invoke_hardware_serial_flush_when_flush_parameter_is_false\n[passed] test_noteserial_arduino_transmit_does_not_modify_hardware_serial_write_result_value_before_returning_to_caller\n==13467==\n==13467== HEAP SUMMARY:\n==13467==     in use at exit: 0 bytes in 0 blocks\n==13467==   total heap usage: 2 allocs, 2 frees, 73,728 bytes allocated\n==13467==\n==13467== All heap blocks were freed -- no leaks are possible\n==13467==\n==13467== For lists of detected and suppressed errors, rerun with: -s\n==13467== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)\nNoteSerial_Arduino tests passed!\n\nAll tests have passed!\n\ngcov (Alpine 10.3.1_git20210424) 10.3.1 20210424\nCopyright (C) 2020 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions.\nThere is NO warranty; not even for MERCHANTABILITY or\nFITNESS FOR A PARTICULAR PURPOSE.\n\nlcov: LCOV version 20200626-2688-g6cc6292bbc\nCapturing coverage data from .\nFound gcov version: 10.3.1\nUsing intermediate gcov format\nScanning . for .gcda files ...\nFound 4 data files in .\nProcessing NoteLog_Arduino.gcda\nProcessing NoteI2c_Arduino.gcda\nProcessing NoteSerial_Arduino.gcda\nProcessing Notecard.gcda\nFinished .info-file creation\nReading tracefile ./coverage/lcov.info\nSummary coverage rate:\n  lines......: 100.0% (215 of 215 lines)\n  functions..: 92.9% (39 of 42 functions)\n  branches...: no data found\n```\n\n### Failure\n\nWhen a test fails, you will see a message similar to the following:\n\n```none\n...\n[passed] test_notei2c_arduino_constructor_invokes_twowire_parameter_begin_method\n[passed] test_notei2c_arduino_receive_requests_response_data_from_notecard\n[FAILED] NoteI2c_Arduino.test.cpp:120\n        twoWireBeginTransmission_Parameters.invoked == 2, EXPECTED: \u003e 1\n        twoWireWriteByte_Parameters.invoked == 4, EXPECTED: \u003e 2\n        twoWireEndTransmission_Parameters.invoked == 2, EXPECTED: \u003e 1\n[FAILED] test_notei2c_arduino_receive_will_retry_transmission_on_i2c_failure\n==14566==\n==14566== HEAP SUMMARY:\n==14566==     in use at exit: 0 bytes in 0 blocks\n==14566==   total heap usage: 7 allocs, 7 frees, 73,738 bytes allocated\n==14566==\n==14566== All heap blocks were freed -- no leaks are possible\n==14566==\n==14566== For lists of detected and suppressed errors, rerun with: -s\n==14566== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)\nNoteI2c_Arduino tests failed!\n\nTESTS FAILED!!!\n```\n\nHere, the failed test is the last reported test,\n`test_notei2c_arduino_receive_will_retry_transmission_on_i2c_failure`. The first\nline marked with `[FAILED]` indicates the file and line number related to the\nfailed test: file `NoteI2c_Arduino.test.cpp` near line `120`. The return value\nof each test is a non-zero identifier related to the test suite.\n\n### Adding a New Test\n\nThe signature of a test function is `int(*test_fn)(void)`, so to say, a test\nfunction takes NO parameters and returns an integer.\n\nTo add a new test to a test suite, create your new test and add the test\nto the test runner at the bottom of the file. You may find it easiest to copy\nan existing test and adapt the **Arrange**, **Action**, and **Assert** sections.\nPlease create an expressive error message that can assist in understanding a\nfailed test.\n\nTo add a test to the runner, copy the test's name and use it to create an entry\nin the `tests` array in the `main` function. The entry will occupy it's own line\nat the end of the array, and syntax should be as follows,\n`{test_name, \"test_name\"},`.\n\n## Generating a Release\n\n### Update `note-c` dependency\n\nThis library depends on the Blues [`note-c` library][note-c]. To update this\nrepo with the latest from `note-c`, run the `update_note_c.sh` shell script\nfrom the `scripts/` folder:\n\n```none\nscripts/update_note_c.sh\n```\n\n_**NOTE:** It is important to use the script. It utilizes git subtrees to\ninclude the appropriate files in the `src/note-c` folder. It also eliminates\nfolders that necessary for testing `note-c` individually, but interfere with\nthe Arduino build environment._\n\n### Update Version Files\n\nWhen generating a release of the `note-arduino` library, you will need to update\nthe version in two places.\n\n- `NoteDefines.h`\n\n    The `note-arduino` library provides preprocessor defines to allow for\n    programmatic access to the version number. The following preprocessor\n    defines should be updated with the version you wish to publish:\n\n    - `NOTE_ARDUINO_VERSION_MAJOR`\n    - `NOTE_ARDUINO_VERSION_MINOR`\n    - `NOTE_ARDUINO_VERSION_PATCH`\n\n- `library.properties`\n\n    Update the `version` key to reflect the version you wish to publish. The\n    version string should follow the form \"\\\u003cmajor\\\u003e.\\\u003cminor\\\u003e.\\\u003cpatch\\\u003e\" (e.g.\n    `1.6.4`). This value will be used by the Arduino Library Manager.\n\n### Arduino Library Manager Release\n\nPublishing a release on GitHub will trigger the Arduino Library Manager. The\nArduino Library Manager will look to the `library.properties` file, and generate\na release based solely on the `version` value it finds there.\n\n_**NOTE:** The GitHub version is not evaluated by the Arduino Library Manager._\n\n## More Information\n\nFor additional Notecard SDKs and Libraries, see:\n\n* [note-c][note-c] for Standard C support\n* [note-go][note-go] for Go\n* [note-python][note-python] for Python\n\n## To learn more about Blues, the Notecard and Notehub, see:\n\n* [blues.com](https://blues.com)\n* [notehub.io][Notehub]\n* [wireless.dev](https://wireless.dev)\n\n## License\n\nCopyright (c) 2019 Blues Inc. Released under the MIT license. See\n[LICENSE](LICENSE) for details.\n\n[blues]: https://blues.com\n[notehub]: https://notehub.io\n[note-c]: https://github.com/blues/note-c\n[note-go]: https://github.com/blues/note-go\n[note-python]: https://github.com/blues/note-python\n[archive]: https://github.com/blues/note-arduino/archive/master.zip\n[code of conduct]: https://blues.github.io/opensource/code-of-conduct\n[Notehub]: https://notehub.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblues%2Fnote-arduino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblues%2Fnote-arduino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblues%2Fnote-arduino/lists"}