{"id":13393359,"url":"https://github.com/carloop/carloop-library","last_synced_at":"2026-01-17T02:32:09.432Z","repository":{"id":70316259,"uuid":"54324068","full_name":"carloop/carloop-library","owner":"carloop","description":"Carloop library for the Particle platform","archived":false,"fork":false,"pushed_at":"2022-01-20T16:16:30.000Z","size":33,"stargazers_count":126,"open_issues_count":3,"forks_count":24,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-10-26T18:29:55.981Z","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/carloop.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-03-20T15:08:25.000Z","updated_at":"2024-09-18T03:21:05.000Z","dependencies_parsed_at":"2023-04-25T11:02:03.141Z","dependency_job_id":null,"html_url":"https://github.com/carloop/carloop-library","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/carloop%2Fcarloop-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carloop%2Fcarloop-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carloop%2Fcarloop-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carloop%2Fcarloop-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carloop","download_url":"https://codeload.github.com/carloop/carloop-library/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243469154,"owners_count":20295697,"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":"2024-07-30T17:00:51.083Z","updated_at":"2026-01-17T02:32:09.312Z","avatar_url":"https://github.com/carloop.png","language":"C++","readme":"# [Carloop](https://www.carloop.io)\n[![Build Status](https://travis-ci.org/carloop/carloop-library.svg?branch=master)](https://travis-ci.org/carloop/carloop-library)\n\nMake apps for your car using signals from OBD-II, CAN and GPS. Publish data online using the Particle platform.\n\nThe [hardware](https://github.com/carloop/hardware) and [software](https://github.com/carloop/carloop-library) is all open source!\n\n### _Don't have one yet? [Buy a Carloop here](https://store.carloop.io)_\n### _Have questions? [Ask the Carloop community.](https://community.carloop.io)_\n### _Want to learn about Car Hacking? [Read this book](https://store.carloop.io/products/car-hackers-handbook)_\n\n## Usage\n\n```\n#include \"carloop/carloop.h\"\nCarloop\u003cCarloopRevision2\u003e carloop;\n\nvoid setup()\n{\n    carloop.begin();\n}\n\nvoid loop()\n{\n    carloop.update();\n    CANMessage message;\n    if(carloop.can().receive(message)) {\n        // Do awesome things with message!\n    }\n}\n```\n\nSee complete examples in [the examples directory.](/examples)\n\n## Getting started\n\n[Follow these instructions on the community](https://community.carloop.io/t/carloop-demo-program/18) to create your first application using the Carloop library.\n\nLearn about programming with the Particle platform at \u003chttps://docs.particle.io\u003e\n\nIf you want to add a GPS, get the [Carloop Pro](https://store.carloop.io/products/carloop-pro-1)\n\n## Documentation\n\n### `Carloop` object\n\nCreate a global `Carloop` object and specify the hardware revision (`CarloopRevision2`). Find this information on the Carloop circuit board (R2.1 means revision 2).\n\nCall `begin()` in `setup()` and `update()` in `loop()`.\n\n```\nCarloop\u003cCarloopRevision2\u003e carloop;\n\nvoid setup() {\n  carloop.begin();\n}\n\nvoid loop() {\n  carloop.update();\n}\n```\n\n### `can()`\n\nRead and write raw CAN messages.\n\n```\nvoid setup() {\n    carloop.begin();\n    Serial.begin(9600);\n}\n\nvoid loop() {\n    carloop.update();\n    CANMessage message;\n    while(carloop.can().receive(message))\n    {\n        Serial.printf(\"ID %03x len %d\", message.id, message.length);\n        for(int i = 0; i \u003c message.length; i++) {\n            Serial.printf(\"%02x \", message.data[i]);\n        }\n        Serial.print(\"\\n\");\n    }\n}\n```\n\n[See the documentation for the Particle CAN driver for more options.](https://docs.particle.io/reference/firmware/photon/#can-canbus-)\n\n### `gps()`\n\nIf you have a GPS connected to the Carloop, you access GPS function through the TinyGPS object with `carloop.gps()`. To ensure that the GPS location doesn't update in the middle of reading it, surround the block where you extract the GPS data in a `WITH_LOCK` block.\n\n```\nWITH_LOCK(carloop.gps()) {\n  float lat = carloop.gps().location.lat();\n  float lng = carloop.gps().location.lng();\n  bool gpsValid = carloop.gps().location.isValid();\n}\n```\n\n[See the TinyGPS library for detailed examples.](https://github.com/codegardenllc/tiny_gps_plus)\n\n### `battery()`\n\nThe voltage of the car battery. Make sure you call `carloop.update()` in the `loop()` function to update the battery voltage.\n\n```\nfloat battVoltage = carloop.battery();\n```\n\n## TODO\n\n- OBD PID decoder. `carloop[\"engine_speed\"]` to get engine speed.\n- OBD fault code reader.\n\n## License\n\nCopyright 2016-2017 1000 Tools, Inc. Distributed under the MIT license. See [LICENSE](/license) for details.\n\n","funding_links":[],"categories":["Community Libraries","Hardware"],"sub_categories":["Android Things"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarloop%2Fcarloop-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarloop%2Fcarloop-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarloop%2Fcarloop-library/lists"}