{"action":"created","comment":{"url":"https://api.github.com/repos/nanosplit/ticket_dispenser/pulls/comments/41791063","id":41791063,"diff_hunk":"@@ -1,149 +1,203 @@\n-#include <Wire.h>\n-\n+#include \"Wire.h\"\n #include \"Keypad.h\"\n #include \"Adafruit_LEDBackpack.h\"\n #include \"Adafruit_GFX.h\"\n \n Adafruit_7segment matrix = Adafruit_7segment();\n-\n+//\n // Setup the keypad\n-const byte ROWS = 4; //four rows\n-const byte COLS = 3; //three columns\n+//\n+const byte ROWS = 4;\n+const byte COLS = 3;\n char keys[ROWS][COLS] = {\n-  {1,2,3},\n-  {4,5,6},\n-  {7,8,9},\n-  {'*','^','#'}\n+\t{1,2,3},\n+\t{4,5,6},\n+\t{7,8,9},\n+\t{'*','^','#'}\n };","path":"ticket_dispenser.c","position":26,"original_position":26,"commit_id":"d9b6417e08ad939a021339d0e04e41e0e0a9fbf8","original_commit_id":"d9b6417e08ad939a021339d0e04e41e0e0a9fbf8","user":{"login":"nanosplit","id":7593664,"avatar_url":"https://avatars.githubusercontent.com/u/7593664?v=3","gravatar_id":"","url":"https://api.github.com/users/nanosplit","html_url":"https://github.com/nanosplit","followers_url":"https://api.github.com/users/nanosplit/followers","following_url":"https://api.github.com/users/nanosplit/following{/other_user}","gists_url":"https://api.github.com/users/nanosplit/gists{/gist_id}","starred_url":"https://api.github.com/users/nanosplit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nanosplit/subscriptions","organizations_url":"https://api.github.com/users/nanosplit/orgs","repos_url":"https://api.github.com/users/nanosplit/repos","events_url":"https://api.github.com/users/nanosplit/events{/privacy}","received_events_url":"https://api.github.com/users/nanosplit/received_events","type":"User","site_admin":false},"body":"Funny, these things kicked my butt until this, then it finally clicked and I'm now wondering why I had such issue with them before!","created_at":"2015-10-12T19:17:18Z","updated_at":"2015-10-12T19:17:18Z","html_url":"https://github.com/nanosplit/ticket_dispenser/pull/1#discussion_r41791063","pull_request_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/nanosplit/ticket_dispenser/pulls/comments/41791063"},"html":{"href":"https://github.com/nanosplit/ticket_dispenser/pull/1#discussion_r41791063"},"pull_request":{"href":"https://api.github.com/repos/nanosplit/ticket_dispenser/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/nanosplit/ticket_dispenser/pulls/1","id":47386486,"html_url":"https://github.com/nanosplit/ticket_dispenser/pull/1","diff_url":"https://github.com/nanosplit/ticket_dispenser/pull/1.diff","patch_url":"https://github.com/nanosplit/ticket_dispenser/pull/1.patch","issue_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/issues/1","number":1,"state":"open","locked":false,"title":"state machine - better counter","user":{"login":"nanosplit","id":7593664,"avatar_url":"https://avatars.githubusercontent.com/u/7593664?v=3","gravatar_id":"","url":"https://api.github.com/users/nanosplit","html_url":"https://github.com/nanosplit","followers_url":"https://api.github.com/users/nanosplit/followers","following_url":"https://api.github.com/users/nanosplit/following{/other_user}","gists_url":"https://api.github.com/users/nanosplit/gists{/gist_id}","starred_url":"https://api.github.com/users/nanosplit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nanosplit/subscriptions","organizations_url":"https://api.github.com/users/nanosplit/orgs","repos_url":"https://api.github.com/users/nanosplit/repos","events_url":"https://api.github.com/users/nanosplit/events{/privacy}","received_events_url":"https://api.github.com/users/nanosplit/received_events","type":"User","site_admin":false},"body":"- added a state machine for counting tickets \r\n- updated variables to be more clear \r\n- more inline comments\r\n\r\n\r\n#### state machine\r\nSetup so that tickets_dispensed++ is only counted if a gap has been detected in the tickets,\r\nwhich is indicated by a 0 (LOW) from the opto_signal_pin (opto_signal_status), but only if the \r\nlast status was that there were no gaps detected. This ensures accurate counting and decreases\r\nfalse positives due to bad timing.\r\n\r\n#### updated variables\r\nUpdated many of the variables to be easier to understand","created_at":"2015-10-12T05:22:17Z","updated_at":"2015-10-12T19:17:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4641c009cc1555831ddf0702a0d566559b5e182d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/pulls/1/commits","review_comments_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/pulls/1/comments","review_comment_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/issues/1/comments","statuses_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/statuses/d9b6417e08ad939a021339d0e04e41e0e0a9fbf8","head":{"label":"nanosplit:state-machine","ref":"state-machine","sha":"d9b6417e08ad939a021339d0e04e41e0e0a9fbf8","user":{"login":"nanosplit","id":7593664,"avatar_url":"https://avatars.githubusercontent.com/u/7593664?v=3","gravatar_id":"","url":"https://api.github.com/users/nanosplit","html_url":"https://github.com/nanosplit","followers_url":"https://api.github.com/users/nanosplit/followers","following_url":"https://api.github.com/users/nanosplit/following{/other_user}","gists_url":"https://api.github.com/users/nanosplit/gists{/gist_id}","starred_url":"https://api.github.com/users/nanosplit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nanosplit/subscriptions","organizations_url":"https://api.github.com/users/nanosplit/orgs","repos_url":"https://api.github.com/users/nanosplit/repos","events_url":"https://api.github.com/users/nanosplit/events{/privacy}","received_events_url":"https://api.github.com/users/nanosplit/received_events","type":"User","site_admin":false},"repo":{"id":43840872,"name":"ticket_dispenser","full_name":"nanosplit/ticket_dispenser","owner":{"login":"nanosplit","id":7593664,"avatar_url":"https://avatars.githubusercontent.com/u/7593664?v=3","gravatar_id":"","url":"https://api.github.com/users/nanosplit","html_url":"https://github.com/nanosplit","followers_url":"https://api.github.com/users/nanosplit/followers","following_url":"https://api.github.com/users/nanosplit/following{/other_user}","gists_url":"https://api.github.com/users/nanosplit/gists{/gist_id}","starred_url":"https://api.github.com/users/nanosplit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nanosplit/subscriptions","organizations_url":"https://api.github.com/users/nanosplit/orgs","repos_url":"https://api.github.com/users/nanosplit/repos","events_url":"https://api.github.com/users/nanosplit/events{/privacy}","received_events_url":"https://api.github.com/users/nanosplit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nanosplit/ticket_dispenser","description":"DIY Ticket Dispenser","fork":false,"url":"https://api.github.com/repos/nanosplit/ticket_dispenser","forks_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/forks","keys_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/teams","hooks_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/hooks","issue_events_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/issues/events{/number}","events_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/events","assignees_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/assignees{/user}","branches_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/branches{/branch}","tags_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/tags","blobs_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/git/refs{/sha}","trees_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/statuses/{sha}","languages_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/languages","stargazers_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/stargazers","contributors_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/contributors","subscribers_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/subscribers","subscription_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/subscription","commits_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/commits{/sha}","git_commits_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/git/commits{/sha}","comments_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/comments{/number}","issue_comment_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/issues/comments{/number}","contents_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/contents/{+path}","compare_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/merges","archive_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/downloads","issues_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/issues{/number}","pulls_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/pulls{/number}","milestones_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/milestones{/number}","notifications_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/labels{/name}","releases_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/releases{/id}","created_at":"2015-10-07T19:45:40Z","updated_at":"2015-10-11T10:39:44Z","pushed_at":"2015-10-12T05:22:17Z","git_url":"git://github.com/nanosplit/ticket_dispenser.git","ssh_url":"git@github.com:nanosplit/ticket_dispenser.git","clone_url":"https://github.com/nanosplit/ticket_dispenser.git","svn_url":"https://github.com/nanosplit/ticket_dispenser","homepage":"","size":0,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"nanosplit:master","ref":"master","sha":"96e41ca50f4d3c05dc20356ab81d105a99dccf04","user":{"login":"nanosplit","id":7593664,"avatar_url":"https://avatars.githubusercontent.com/u/7593664?v=3","gravatar_id":"","url":"https://api.github.com/users/nanosplit","html_url":"https://github.com/nanosplit","followers_url":"https://api.github.com/users/nanosplit/followers","following_url":"https://api.github.com/users/nanosplit/following{/other_user}","gists_url":"https://api.github.com/users/nanosplit/gists{/gist_id}","starred_url":"https://api.github.com/users/nanosplit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nanosplit/subscriptions","organizations_url":"https://api.github.com/users/nanosplit/orgs","repos_url":"https://api.github.com/users/nanosplit/repos","events_url":"https://api.github.com/users/nanosplit/events{/privacy}","received_events_url":"https://api.github.com/users/nanosplit/received_events","type":"User","site_admin":false},"repo":{"id":43840872,"name":"ticket_dispenser","full_name":"nanosplit/ticket_dispenser","owner":{"login":"nanosplit","id":7593664,"avatar_url":"https://avatars.githubusercontent.com/u/7593664?v=3","gravatar_id":"","url":"https://api.github.com/users/nanosplit","html_url":"https://github.com/nanosplit","followers_url":"https://api.github.com/users/nanosplit/followers","following_url":"https://api.github.com/users/nanosplit/following{/other_user}","gists_url":"https://api.github.com/users/nanosplit/gists{/gist_id}","starred_url":"https://api.github.com/users/nanosplit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nanosplit/subscriptions","organizations_url":"https://api.github.com/users/nanosplit/orgs","repos_url":"https://api.github.com/users/nanosplit/repos","events_url":"https://api.github.com/users/nanosplit/events{/privacy}","received_events_url":"https://api.github.com/users/nanosplit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nanosplit/ticket_dispenser","description":"DIY Ticket Dispenser","fork":false,"url":"https://api.github.com/repos/nanosplit/ticket_dispenser","forks_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/forks","keys_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/teams","hooks_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/hooks","issue_events_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/issues/events{/number}","events_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/events","assignees_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/assignees{/user}","branches_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/branches{/branch}","tags_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/tags","blobs_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/git/refs{/sha}","trees_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/statuses/{sha}","languages_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/languages","stargazers_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/stargazers","contributors_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/contributors","subscribers_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/subscribers","subscription_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/subscription","commits_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/commits{/sha}","git_commits_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/git/commits{/sha}","comments_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/comments{/number}","issue_comment_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/issues/comments{/number}","contents_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/contents/{+path}","compare_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/merges","archive_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/downloads","issues_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/issues{/number}","pulls_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/pulls{/number}","milestones_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/milestones{/number}","notifications_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/labels{/name}","releases_url":"https://api.github.com/repos/nanosplit/ticket_dispenser/releases{/id}","created_at":"2015-10-07T19:45:40Z","updated_at":"2015-10-11T10:39:44Z","pushed_at":"2015-10-12T05:22:17Z","git_url":"git://github.com/nanosplit/ticket_dispenser.git","ssh_url":"git@github.com:nanosplit/ticket_dispenser.git","clone_url":"https://github.com/nanosplit/ticket_dispenser.git","svn_url":"https://github.com/nanosplit/ticket_dispenser","homepage":"","size":0,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nanosplit/ticket_dispenser/pulls/1"},"html":{"href":"https://github.com/nanosplit/ticket_dispenser/pull/1"},"issue":{"href":"https://api.github.com/repos/nanosplit/ticket_dispenser/issues/1"},"comments":{"href":"https://api.github.com/repos/nanosplit/ticket_dispenser/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/nanosplit/ticket_dispenser/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/nanosplit/ticket_dispenser/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nanosplit/ticket_dispenser/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/nanosplit/ticket_dispenser/statuses/d9b6417e08ad939a021339d0e04e41e0e0a9fbf8"}}}}