{"id":26064846,"url":"https://github.com/syncano/syncano-arduino","last_synced_at":"2025-04-11T14:11:11.087Z","repository":{"id":77440680,"uuid":"49446653","full_name":"Syncano/syncano-arduino","owner":"Syncano","description":"Syncano's Arduino Library","archived":false,"fork":false,"pushed_at":"2016-07-13T08:25:21.000Z","size":73,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-25T10:21:24.044Z","etag":null,"topics":[],"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/Syncano.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":"2016-01-11T18:48:53.000Z","updated_at":"2024-08-27T16:16:18.000Z","dependencies_parsed_at":"2023-03-02T04:00:36.716Z","dependency_job_id":null,"html_url":"https://github.com/Syncano/syncano-arduino","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Syncano%2Fsyncano-arduino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Syncano%2Fsyncano-arduino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Syncano%2Fsyncano-arduino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Syncano%2Fsyncano-arduino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Syncano","download_url":"https://codeload.github.com/Syncano/syncano-arduino/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248414196,"owners_count":21099437,"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":[],"created_at":"2025-03-08T18:49:31.583Z","updated_at":"2025-04-11T14:11:11.080Z","avatar_url":"https://github.com/Syncano.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arduino Library for Syncano\n\nArduino library for Syncano provides support for Arduino Yún.\n\nThis library let you use Syncano as Cloud for your connected devices.\n\nIn case of any questions or feedback, please do not hesitate to contact us on: `#iot` channel at [Syncano-community Slack](https://syncano-community.slack.com/messages/iot/)\n\n## Getting started\n\nThis library is inteded to be used with a [Syncano](https://www.syncano.io/) account. If you don't already have one - you can sign up [here](https://dashboard.syncano.io/?utm_source=github\u0026amp;utm_medium=readme\u0026amp;utm_campaign=syncano-js).\n\n### Syncano Template\n\nIn order to use Syncano Arduino library, you have to create the template in Syncano. Templates can be found in `\u003c\u003e Snippets` section in your dashboard. \nName your new template `arduino` and set it content type to `application/json`. Then just copy the code below into it and save.\n~~~~\n{%- set fields_to_skip = [\n        \"group\",\n        \"group_permissions\",\n        \"owner_permissions\",\n        \"other_permissions\",\n        \"owner\",\n        \"revision\",\n        \"updated_at\",\n        \"created_at\"\n    ]\n-%}\n{%- if action == 'create' or action =='partial_update' -%}\n    {%- if 'id' in response -%}\n        {{response.id|int()}}\n    {%- elif 'status' or 'type' in response -%}\n        {{'1'|int()}}\n    {%- else -%}\n        {{'0'|int()}}\n    {%- endif -%}\n{%- elif payload -%}\n{\n    {%- for key, value in payload.iteritems() if key not in fields_to_skip -%}\n        \"{{key}}\":\n        {%- if value is number -%}\n            {{value}}\n        {%- else -%}\n            \"{{value}}\"\n        {%- endif -%}\n        {%- if not loop.last -%}\n            ,\n        {%- endif -%}\n    {%- endfor -%}\n}  \n{%- endif -%}\n~~~~\n\n### Installation\n\nTo use this library copy folder SyncanoArduinoLibrary from [GitHub](https://github.com/Syncano/syncano-arduino/archive/master.zip) to your Custom Arduino Library Folder.\n\n### Include library\n\nIn your sketch you have to include library.\n~~~~ c++\n#include \u003cSyncano.h\u003e\n~~~~\n\n### Define consts\nNext you have to define your Syncano Api Key\n~~~~ c++\n#define ACCOUNT_KEY \"API_KEY\"\n~~~~\nOptionally you can define other const like Syncano Instance Name, Object Id or Webhook Name.\n### Setup your sketch\nBefore setup function you have to define pointer to Syncano object:\n~~~~ c++\nSyncanoClient* syncano;\n~~~~\n\nIn setup function you can prepare syncano object to connect to Syncano.io\n~~~~ c++\ninitSyncanoClient(ACCOUNT_KEY);\nsyncano = getSyncanoClient();\nsyncano-\u003esetInstanceName(\"INSTANCE_NAME\");\n~~~~\n\n### Main loop\n\nFor example, you can use library to parse Syncano classes.\nFirst you have to create Class in Syncano ( or use existing ), then you can use details() method to fetch Class schema to local object.\nAfter this step you can create object based on this class or simply write class fields to Serial output by using printDetails() method.\n\n~~~~ c++\nSyncanoClass* classHolder = new SyncanoClass(CLASS_NAME);\n\nSerial.println(\"Class details example:\");\nclassHolder-\u003edetails();\nclassHolder-\u003eprintDetails();\n~~~~\n\n## Documentation\n\nIf you want to generate local version of documentation, simply use [doxygen](http://www.stack.nl/~dimitri/doxygen/index.html) with additional [graphviz](http://www.graphviz.org/) tool installed. \n\n[Doxygen installation instruction](http://www.stack.nl/~dimitri/doxygen/download.html)\n\nGenerating documentation on Ubuntu:\n~~~~ bash\nsudo apt-get install doxygen graphviz\ncd [PATH_TO_LIBRARY_DIR]\ndoxygen ./Doxyfile\n~~~~\nDocumentation can be found in new directory called *auto_docs*\n\nYou can also visit our  [documentation website](http://docs.eyedea.ninja/) for actual documentation version.\n\n## Examples\nWe have prepared set of examples ready to use with Syncano. You can find them on our [GitHub site](https://github.com/Syncano/syncano-arduino/tree/master/examples), [Playground](http://eyedea.ninja/) or directly in your Adruino IDE in examples section.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyncano%2Fsyncano-arduino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyncano%2Fsyncano-arduino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyncano%2Fsyncano-arduino/lists"}