{"id":13566065,"url":"https://github.com/r-arduino/arduinor","last_synced_at":"2025-04-03T23:31:00.407Z","repository":{"id":217999867,"uuid":"168023027","full_name":"r-arduino/arduinor","owner":"r-arduino","description":"An easy way to get arduino data into R","archived":false,"fork":false,"pushed_at":"2020-10-06T19:57:50.000Z","size":2574,"stargazers_count":88,"open_issues_count":0,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-04T20:41:32.752Z","etag":null,"topics":["arduino","r"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r-arduino.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-01-28T19:30:00.000Z","updated_at":"2024-08-04T02:33:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"d73cf3d5-3873-41c6-8114-13e054cfa631","html_url":"https://github.com/r-arduino/arduinor","commit_stats":null,"previous_names":["r-arduino/arduinor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-arduino%2Farduinor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-arduino%2Farduinor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-arduino%2Farduinor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-arduino%2Farduinor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-arduino","download_url":"https://codeload.github.com/r-arduino/arduinor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247097662,"owners_count":20883122,"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","r"],"created_at":"2024-08-01T13:02:01.344Z","updated_at":"2025-04-03T23:30:58.495Z","avatar_url":"https://github.com/r-arduino.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"# arduinor \u003cimg src=\"docs/arduinor.png\" align=\"right\" alt=\"logo\" width=\"120\" height = \"139\" style = \"border: none; float: right;\"\u003e\n[![CRAN_version](http://www.r-pkg.org/badges/version/arduinor)](https://cran.r-project.org/package=arduinor)\n[![CRAN_download](http://cranlogs.r-pkg.org/badges/arduinor)](https://cran.r-project.org/package=arduinor)\n[![CRAN_download_total](http://cranlogs.r-pkg.org/badges/grand-total/arduinor)](https://cran.r-project.org/package=arduinor)\n\n`arduinor` package provides a simplified approach to get serial data from arduino to R. Right now it depends on [Tod E. Kurt](https://github.com/todbot)'s [arduinoSerial](https://github.com/todbot/arduino-serial) C library, which can **only runs on POSIX-compatible systems, such as Mac OS X and Linux**. As a result, for now this package can only runs on these systems as well. \n\nI'm working on getting this [libserialport](https://sigrok.org/wiki/Libserialport) C++ package to R. Once I finished the importing, I will try to move the dependencies of this package on top of that. So hopefully, in the future, we will be able to get this work on Windows as well. \n\n# Installation\n```r\ndevtools::install_github(\"r-arduino/arduinor\")\n```\n\n# Getting Started\n\n\u003e For a more detailed walk-through, check out [this blog-post](https://haozhu233.com/post/connect-arduino-chips-with-r/).\n\nThis package offers a simplified workflow to work with arduino connections. \n\n```r\nlibrary(arduinor)\n\ncon \u003c- ar_init(\"/dev/cu.SLAB_USBtoUART\", baud = 57600)  \n\nar_flush_hard(con) # Flush the port to remove initial random readings\nar_read(con)\n[1] \"8510106,8976,-7748,-11848\\r\\n\"\n```\n\nYou can find the connection port at the footnote of your Arduino IDE window. \n\n![](docs/port.png)\n\nAnd you should have setuped your Baud rate somewhere in your arduino `void setup`\n\n```\nvoid setup(){\n  ...\n  Serial.begin(57600);\n  ...\n}\n\n```\n\n## ar_monitor\n`ar_monitor` streams the arduino output into your R console, like the \"Serial Monitor\" feature in Arduino IDE. It will stop when you hit the `STOP` button.\n\n![](docs/ar_monitor.gif)\n\n## ar_collect\n`ar_collect` is similar with `ar_monitor` except the fact that it will save a *limited* amount of data into a R.\n\n```r\n\u003e dt \u003c- ar_collect(con, size = 300)\nFlushing Port...\nDone  \n\u003e length(dt)\n[1] 300\n```\n\n## ar_plotter\n`ar_plotter` aims to provide you something similar with the \"Serial Plotter\" in\nArduino IDE but give you more power to control: \n\n- You have the ability to `Pause`/`Start`. \n- You have the ability to select variable to display.\n- You have the ability to name the variables in the way you provided.\n- You can choose to save the observations in a csv file. \n\n![](docs/ar_plotter.png)\n\n\u003e However, note that due to a limitation in plotly (? not confirmed yet), this plotter can't visualize signals sampling at a 25Hz or higher (on my computer) and it will freeze your R session if you do that. Therefore for now I added a `reduce_freq` option to `ar_plotter` with default ON. It will add a 40ms (0.04s) delay for every reading. If you are looking for a more precised way to **collect** data, you can either choose to turn this option off or use `ar_collect`, which is much simpler and can work in any condition.\n\n# Credits\nPart of this work goes to the a study project running at [Marcus Institute for Aging Research](https://www.marcusinstituteforaging.org/). It won't happen without the support from [Brad Manor](https://www.marcusinstituteforaging.org/scientists/team-profiles-and-bios/brad-manor-phd) and his grant funding (1-K01-AG044543–01A1). This project was also supported by the leadership from [Tom Travison](https://www.marcusinstituteforaging.org/scientists/team-profiles-and-bios/thomas-travison-phd) and the funding support from the Boston Claude D. Pepper Older Americans Independence Center (P30-AG013679). \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-arduino%2Farduinor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-arduino%2Farduinor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-arduino%2Farduinor/lists"}