{"id":19938815,"url":"https://github.com/raphaelbs/arduinoporta","last_synced_at":"2025-10-26T10:25:18.193Z","repository":{"id":91345841,"uuid":"51798974","full_name":"raphaelbs/ArduinoPorta","owner":"raphaelbs","description":"The Arduino-like side of Porta's easy implementation.","archived":false,"fork":false,"pushed_at":"2016-09-20T00:11:05.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-12T04:07:37.718Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Arduino","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/raphaelbs.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":"2016-02-16T01:35:42.000Z","updated_at":"2016-02-16T01:37:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"1e05e5f8-8230-4dea-8a93-da430b5d6f68","html_url":"https://github.com/raphaelbs/ArduinoPorta","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelbs%2FArduinoPorta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelbs%2FArduinoPorta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelbs%2FArduinoPorta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelbs%2FArduinoPorta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphaelbs","download_url":"https://codeload.github.com/raphaelbs/ArduinoPorta/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241367930,"owners_count":19951444,"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-11-12T23:42:01.986Z","updated_at":"2025-10-26T10:25:18.133Z","avatar_url":"https://github.com/raphaelbs.png","language":"Arduino","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ArduinoPorta\nThis is an Arduino sketch of Porta's easy implementation.\n[Porta](https://play.google.com/store/apps/details?id=com.createlier.porta) is a really simple and direct way of use arduino-bluetooth solutions in a daily basis.\n\n- [Insctructables](http://www.instructables.com/id/Android-and-Arduino-With-Bluetooth-Using-Porta-App/)\n- [Youtube](https://youtu.be/Vc3NNrHip3I)\n\n## Sketch\nIn this demo we use an Arduino to open and close doors using step-motor and bluetooth.\n\n```c++\n#include \u003cStepper.h\u003e\n\nconst int stepsPerRevolution = 2048;\nStepper myStepper(stepsPerRevolution, 2, 3, 4, 5);\nbool isOpen = false;\nint stepsRequired = 2048;\n\nvoid setup() {\n  // set the speed at 60 rpm:\n  myStepper.setSpeed(12);\n  // initialize the serial port:\n  Serial.begin(9600);\n  Serial.println(\"Welcome to Porta's Arduino Serial Communication\");\n  Serial.println(\"The firmware is listening for three actions commands:\");\n  Serial.println(\" - toggle : open and close door\");\n  Serial.println(\" - open : open door\");\n  Serial.println(\" - close : close door\");\n  Serial.println(\"You can also set the step/action using:\");\n  Serial.println(\" - sr[number] : where number is the step required. I.e.: sr2048 \");\n}\n\nvoid loop() {\n  if(Serial.available()){\n    char serialBuffer[8];\n    // IMPORTART: setting the Arduino to read until a break-line is detected\n\tchar linebreak = '\\n'; \\\\ Here is the line-break I talked about\n\tint finalSize = Serial.readBytesUntil(linebreak , serialBuffer, 8); \n    serialBuffer[finalSize] = '\\0';\n    handler(serialBuffer);\n  }\n}\n\nvoid handler(String in){\n  if(in == \"toggle\"){\n    // IMPORTART: always send message using println() or '\\n' to break-line\n    Serial.println(\"toggle\");\n    if(isOpen){\n      myStepper.step(stepsRequired);\n    }else{\n      myStepper.step(-stepsRequired);\n    }\n    isOpen = !isOpen;\n    delay(500);\n  }\n  if(in == \"open\"){\n    Serial.println(\"open\");\n    myStepper.step(-stepsRequired);\n    isOpen = true;\n    delay(500);\n  }\n  if(in == \"close\"){\n    Serial.println(\"close\");\n    myStepper.step(stepsRequired);\n    isOpen = false;\n    delay(500);\n  }\n  if(in.charAt(0)=='s' \u0026\u0026 in.charAt(1)=='r'){\n    Serial.print(\"Changing steps/action from \");\n    Serial.print(stepsRequired);\n    Serial.print(\" to \");\n    in = in.substring(2);\n    int newSteps = in.toInt();\n    Serial.println(newSteps);\n    stepsRequired = newSteps;\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelbs%2Farduinoporta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphaelbs%2Farduinoporta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelbs%2Farduinoporta/lists"}