{"action":"created","comment":{"url":"https://api.github.com/repos/novoda/spikes/pulls/comments/81705964","pull_request_review_id":2665421,"id":81705964,"diff_hunk":"@@ -0,0 +1,140 @@\n+#include <AFMotor.h> // from https://github.com/adafruit/Adafruit-Motor-Shield-library\n+#include <Servo.h> \n+\n+AF_DCMotor motorRight1(3);\n+AF_DCMotor motorRight2(2);\n+AF_DCMotor motorLeft1(4);\n+AF_DCMotor motorLeft2(1);\n+\n+const char COMMAND_FORWARD = 'w';\n+const char COMMAND_BACKWARD = 's';\n+const char COMMAND_TEST = 't';\n+const int MAX_SPEED = 255;\n+const int DELTA_SPEED = 50;\n+\n+int currentDirection = RELEASE;\n+int currentSpeed = 0;\n+\n+void setup() {\n+  Serial.begin(9600);           \n+  Serial.println(\"Movement unit starting\");\n+}\n+\n+void loop() {\n+  if (Serial.available() == 0) {\n+    return;\n+  }\n+  \n+  char inChar = Serial.read();\n+\n+  switch(inChar) {\n+    case (COMMAND_FORWARD):\n+      increaseForward();\n+      break;\n+    case (COMMAND_BACKWARD):\n+      increaseBackward();\n+      break;\n+    case (COMMAND_TEST):\n+      testMotors();\n+      break;\n+    default:\n+       Serial.println(\"Unknown command \" + inChar);\n+  }\n+}\n+\n+void testMotors() {\n+  int i;\n+  \n+  setRightDirection(FORWARD);\n+  setLeftDirection(FORWARD);\n+  for (i=0; i<255; i++) {\n+    setRightSpeed(i);  \n+    setLeftSpeed(i);  \n+    delay(3);\n+  }\n+\n+    setRightSpeed(255);  \n+    setLeftSpeed(255);   \n+    delay(5000);\n+ \n+ \n+  for (i=255; i!=0; i--) {\n+    setRightSpeed(i);  \n+    setLeftSpeed(i);  \n+    delay(3);\n+  }\n+ \n+  setRightDirection(BACKWARD);\n+  setLeftDirection(BACKWARD);\n+  for (i=0; i<255; i++) {","path":"TelepresenceBot/movement-unit/movement-unit.ino","position":69,"original_position":69,"commit_id":"329f7d42502fbb3bdf0204d8c6c8f192d2e6ecfd","original_commit_id":"329f7d42502fbb3bdf0204d8c6c8f192d2e6ecfd","user":{"login":"takecare","id":212528,"avatar_url":"https://avatars.githubusercontent.com/u/212528?v=3","gravatar_id":"","url":"https://api.github.com/users/takecare","html_url":"https://github.com/takecare","followers_url":"https://api.github.com/users/takecare/followers","following_url":"https://api.github.com/users/takecare/following{/other_user}","gists_url":"https://api.github.com/users/takecare/gists{/gist_id}","starred_url":"https://api.github.com/users/takecare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takecare/subscriptions","organizations_url":"https://api.github.com/users/takecare/orgs","repos_url":"https://api.github.com/users/takecare/repos","events_url":"https://api.github.com/users/takecare/events{/privacy}","received_events_url":"https://api.github.com/users/takecare/received_events","type":"User","site_admin":false},"body":"given this is repeated code it could be extracted but ¯\\_(ツ)_/¯","created_at":"2016-10-04T08:18:04Z","updated_at":"2016-10-04T08:19:15Z","html_url":"https://github.com/novoda/spikes/pull/160#discussion_r81705964","pull_request_url":"https://api.github.com/repos/novoda/spikes/pulls/160","_links":{"self":{"href":"https://api.github.com/repos/novoda/spikes/pulls/comments/81705964"},"html":{"href":"https://github.com/novoda/spikes/pull/160#discussion_r81705964"},"pull_request":{"href":"https://api.github.com/repos/novoda/spikes/pulls/160"}}},"pull_request":{"url":"https://api.github.com/repos/novoda/spikes/pulls/160","id":87687170,"html_url":"https://github.com/novoda/spikes/pull/160","diff_url":"https://github.com/novoda/spikes/pull/160.diff","patch_url":"https://github.com/novoda/spikes/pull/160.patch","issue_url":"https://api.github.com/repos/novoda/spikes/issues/160","number":160,"state":"open","locked":false,"title":"Tpbot/first arduino sketch","user":{"login":"danybony","id":3942812,"avatar_url":"https://avatars.githubusercontent.com/u/3942812?v=3","gravatar_id":"","url":"https://api.github.com/users/danybony","html_url":"https://github.com/danybony","followers_url":"https://api.github.com/users/danybony/followers","following_url":"https://api.github.com/users/danybony/following{/other_user}","gists_url":"https://api.github.com/users/danybony/gists{/gist_id}","starred_url":"https://api.github.com/users/danybony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danybony/subscriptions","organizations_url":"https://api.github.com/users/danybony/orgs","repos_url":"https://api.github.com/users/danybony/repos","events_url":"https://api.github.com/users/danybony/events{/privacy}","received_events_url":"https://api.github.com/users/danybony/received_events","type":"User","site_admin":false},"body":"Adding the first version of the Arduino firmware.\r\nThis is ready to receive commands from serial and it will control all the 4 wheels to go forward (when pressing `w`) or backward (when pressing `s`).\r\nThese commands can be sent using the Arduino Serial Monitor and they will be later sent by the Receiver Android app.\r\n\r\n## Current schematics:\r\n![untitled sketch 2_bb](https://cloud.githubusercontent.com/assets/3942812/19048188/312b0a08-899d-11e6-8a6d-b13426cfff75.png)\r\n\r\n\r\n\r\n**In a next PR**: steering with `a` and `d`","created_at":"2016-10-03T09:36:37Z","updated_at":"2016-10-04T08:19:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"673814e6a1fddd8f48d9a585ee9d27620ab322f8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/novoda/spikes/pulls/160/commits","review_comments_url":"https://api.github.com/repos/novoda/spikes/pulls/160/comments","review_comment_url":"https://api.github.com/repos/novoda/spikes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/novoda/spikes/issues/160/comments","statuses_url":"https://api.github.com/repos/novoda/spikes/statuses/329f7d42502fbb3bdf0204d8c6c8f192d2e6ecfd","head":{"label":"novoda:tpbot/first-arduino-sketch","ref":"tpbot/first-arduino-sketch","sha":"329f7d42502fbb3bdf0204d8c6c8f192d2e6ecfd","user":{"login":"novoda","id":74874,"avatar_url":"https://avatars.githubusercontent.com/u/74874?v=3","gravatar_id":"","url":"https://api.github.com/users/novoda","html_url":"https://github.com/novoda","followers_url":"https://api.github.com/users/novoda/followers","following_url":"https://api.github.com/users/novoda/following{/other_user}","gists_url":"https://api.github.com/users/novoda/gists{/gist_id}","starred_url":"https://api.github.com/users/novoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novoda/subscriptions","organizations_url":"https://api.github.com/users/novoda/orgs","repos_url":"https://api.github.com/users/novoda/repos","events_url":"https://api.github.com/users/novoda/events{/privacy}","received_events_url":"https://api.github.com/users/novoda/received_events","type":"Organization","site_admin":false},"repo":{"id":13300550,"name":"spikes","full_name":"novoda/spikes","owner":{"login":"novoda","id":74874,"avatar_url":"https://avatars.githubusercontent.com/u/74874?v=3","gravatar_id":"","url":"https://api.github.com/users/novoda","html_url":"https://github.com/novoda","followers_url":"https://api.github.com/users/novoda/followers","following_url":"https://api.github.com/users/novoda/following{/other_user}","gists_url":"https://api.github.com/users/novoda/gists{/gist_id}","starred_url":"https://api.github.com/users/novoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novoda/subscriptions","organizations_url":"https://api.github.com/users/novoda/orgs","repos_url":"https://api.github.com/users/novoda/repos","events_url":"https://api.github.com/users/novoda/events{/privacy}","received_events_url":"https://api.github.com/users/novoda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/novoda/spikes","description":"Where ideas & concepts are born & incubated","fork":false,"url":"https://api.github.com/repos/novoda/spikes","forks_url":"https://api.github.com/repos/novoda/spikes/forks","keys_url":"https://api.github.com/repos/novoda/spikes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/novoda/spikes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/novoda/spikes/teams","hooks_url":"https://api.github.com/repos/novoda/spikes/hooks","issue_events_url":"https://api.github.com/repos/novoda/spikes/issues/events{/number}","events_url":"https://api.github.com/repos/novoda/spikes/events","assignees_url":"https://api.github.com/repos/novoda/spikes/assignees{/user}","branches_url":"https://api.github.com/repos/novoda/spikes/branches{/branch}","tags_url":"https://api.github.com/repos/novoda/spikes/tags","blobs_url":"https://api.github.com/repos/novoda/spikes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/novoda/spikes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/novoda/spikes/git/refs{/sha}","trees_url":"https://api.github.com/repos/novoda/spikes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/novoda/spikes/statuses/{sha}","languages_url":"https://api.github.com/repos/novoda/spikes/languages","stargazers_url":"https://api.github.com/repos/novoda/spikes/stargazers","contributors_url":"https://api.github.com/repos/novoda/spikes/contributors","subscribers_url":"https://api.github.com/repos/novoda/spikes/subscribers","subscription_url":"https://api.github.com/repos/novoda/spikes/subscription","commits_url":"https://api.github.com/repos/novoda/spikes/commits{/sha}","git_commits_url":"https://api.github.com/repos/novoda/spikes/git/commits{/sha}","comments_url":"https://api.github.com/repos/novoda/spikes/comments{/number}","issue_comment_url":"https://api.github.com/repos/novoda/spikes/issues/comments{/number}","contents_url":"https://api.github.com/repos/novoda/spikes/contents/{+path}","compare_url":"https://api.github.com/repos/novoda/spikes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/novoda/spikes/merges","archive_url":"https://api.github.com/repos/novoda/spikes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/novoda/spikes/downloads","issues_url":"https://api.github.com/repos/novoda/spikes/issues{/number}","pulls_url":"https://api.github.com/repos/novoda/spikes/pulls{/number}","milestones_url":"https://api.github.com/repos/novoda/spikes/milestones{/number}","notifications_url":"https://api.github.com/repos/novoda/spikes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/novoda/spikes/labels{/name}","releases_url":"https://api.github.com/repos/novoda/spikes/releases{/id}","deployments_url":"https://api.github.com/repos/novoda/spikes/deployments","created_at":"2013-10-03T14:31:43Z","updated_at":"2016-10-03T14:06:31Z","pushed_at":"2016-10-03T21:19:07Z","git_url":"git://github.com/novoda/spikes.git","ssh_url":"git@github.com:novoda/spikes.git","clone_url":"https://github.com/novoda/spikes.git","svn_url":"https://github.com/novoda/spikes","homepage":"","size":33993,"stargazers_count":190,"watchers_count":190,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":38,"mirror_url":null,"open_issues_count":3,"forks":38,"open_issues":3,"watchers":190,"default_branch":"master"}},"base":{"label":"novoda:tpbot-feature-branch","ref":"tpbot-feature-branch","sha":"8b586b7b836c05db1e5ba605b777752fd1d85fc3","user":{"login":"novoda","id":74874,"avatar_url":"https://avatars.githubusercontent.com/u/74874?v=3","gravatar_id":"","url":"https://api.github.com/users/novoda","html_url":"https://github.com/novoda","followers_url":"https://api.github.com/users/novoda/followers","following_url":"https://api.github.com/users/novoda/following{/other_user}","gists_url":"https://api.github.com/users/novoda/gists{/gist_id}","starred_url":"https://api.github.com/users/novoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novoda/subscriptions","organizations_url":"https://api.github.com/users/novoda/orgs","repos_url":"https://api.github.com/users/novoda/repos","events_url":"https://api.github.com/users/novoda/events{/privacy}","received_events_url":"https://api.github.com/users/novoda/received_events","type":"Organization","site_admin":false},"repo":{"id":13300550,"name":"spikes","full_name":"novoda/spikes","owner":{"login":"novoda","id":74874,"avatar_url":"https://avatars.githubusercontent.com/u/74874?v=3","gravatar_id":"","url":"https://api.github.com/users/novoda","html_url":"https://github.com/novoda","followers_url":"https://api.github.com/users/novoda/followers","following_url":"https://api.github.com/users/novoda/following{/other_user}","gists_url":"https://api.github.com/users/novoda/gists{/gist_id}","starred_url":"https://api.github.com/users/novoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novoda/subscriptions","organizations_url":"https://api.github.com/users/novoda/orgs","repos_url":"https://api.github.com/users/novoda/repos","events_url":"https://api.github.com/users/novoda/events{/privacy}","received_events_url":"https://api.github.com/users/novoda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/novoda/spikes","description":"Where ideas & concepts are born & incubated","fork":false,"url":"https://api.github.com/repos/novoda/spikes","forks_url":"https://api.github.com/repos/novoda/spikes/forks","keys_url":"https://api.github.com/repos/novoda/spikes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/novoda/spikes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/novoda/spikes/teams","hooks_url":"https://api.github.com/repos/novoda/spikes/hooks","issue_events_url":"https://api.github.com/repos/novoda/spikes/issues/events{/number}","events_url":"https://api.github.com/repos/novoda/spikes/events","assignees_url":"https://api.github.com/repos/novoda/spikes/assignees{/user}","branches_url":"https://api.github.com/repos/novoda/spikes/branches{/branch}","tags_url":"https://api.github.com/repos/novoda/spikes/tags","blobs_url":"https://api.github.com/repos/novoda/spikes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/novoda/spikes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/novoda/spikes/git/refs{/sha}","trees_url":"https://api.github.com/repos/novoda/spikes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/novoda/spikes/statuses/{sha}","languages_url":"https://api.github.com/repos/novoda/spikes/languages","stargazers_url":"https://api.github.com/repos/novoda/spikes/stargazers","contributors_url":"https://api.github.com/repos/novoda/spikes/contributors","subscribers_url":"https://api.github.com/repos/novoda/spikes/subscribers","subscription_url":"https://api.github.com/repos/novoda/spikes/subscription","commits_url":"https://api.github.com/repos/novoda/spikes/commits{/sha}","git_commits_url":"https://api.github.com/repos/novoda/spikes/git/commits{/sha}","comments_url":"https://api.github.com/repos/novoda/spikes/comments{/number}","issue_comment_url":"https://api.github.com/repos/novoda/spikes/issues/comments{/number}","contents_url":"https://api.github.com/repos/novoda/spikes/contents/{+path}","compare_url":"https://api.github.com/repos/novoda/spikes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/novoda/spikes/merges","archive_url":"https://api.github.com/repos/novoda/spikes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/novoda/spikes/downloads","issues_url":"https://api.github.com/repos/novoda/spikes/issues{/number}","pulls_url":"https://api.github.com/repos/novoda/spikes/pulls{/number}","milestones_url":"https://api.github.com/repos/novoda/spikes/milestones{/number}","notifications_url":"https://api.github.com/repos/novoda/spikes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/novoda/spikes/labels{/name}","releases_url":"https://api.github.com/repos/novoda/spikes/releases{/id}","deployments_url":"https://api.github.com/repos/novoda/spikes/deployments","created_at":"2013-10-03T14:31:43Z","updated_at":"2016-10-03T14:06:31Z","pushed_at":"2016-10-03T21:19:07Z","git_url":"git://github.com/novoda/spikes.git","ssh_url":"git@github.com:novoda/spikes.git","clone_url":"https://github.com/novoda/spikes.git","svn_url":"https://github.com/novoda/spikes","homepage":"","size":33993,"stargazers_count":190,"watchers_count":190,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":38,"mirror_url":null,"open_issues_count":3,"forks":38,"open_issues":3,"watchers":190,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/novoda/spikes/pulls/160"},"html":{"href":"https://github.com/novoda/spikes/pull/160"},"issue":{"href":"https://api.github.com/repos/novoda/spikes/issues/160"},"comments":{"href":"https://api.github.com/repos/novoda/spikes/issues/160/comments"},"review_comments":{"href":"https://api.github.com/repos/novoda/spikes/pulls/160/comments"},"review_comment":{"href":"https://api.github.com/repos/novoda/spikes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/novoda/spikes/pulls/160/commits"},"statuses":{"href":"https://api.github.com/repos/novoda/spikes/statuses/329f7d42502fbb3bdf0204d8c6c8f192d2e6ecfd"}}}}
{"actor":{"display_login":"takecare"}}