{"action":"created","comment":{"url":"https://api.github.com/repos/mysensors/Arduino/pulls/comments/36668465","id":36668465,"diff_hunk":"@@ -0,0 +1,121 @@\n+/*\n+  Arduino Dust Sensor for SamYoung DSM501\n+  connect the sensor as follows :\n+          Pin 2 of dust sensor PM1      -> Digital 3 (PMW)\n+\t  Pin 3 of dust sensor          -> +5V \n+\t  Pin 4 of dust sensor PM2.5    -> Digital 6 (PWM) \n+\t  Pin 5 of dust sensor          -> Ground\n+  Datasheet: http://www.samyoungsnc.com/products/3-1%20Specification%20DSM501.pdf\n+  Contribution: epierre\n+  \n+  The dust sensor used (see purchase guide for latest link):\n+ \n+  \n+*/\n+\n+#include <MySensor.h>  \n+#include <SPI.h>\n+\n+#define CHILD_ID_DUST_PM10            0\n+#define CHILD_ID_DUST_PM25            1\n+#define DUST_SENSOR_DIGITAL_PIN_PM10  6\n+#define DUST_SENSOR_DIGITAL_PIN_PM25  3\n+\n+unsigned long SLEEP_TIME = 30*1000; // Sleep time between reads (in milliseconds)\n+//VARIABLES\n+int val = 0;           // variable to store the value coming from the sensor\n+float valDUSTPM25 =0.0;\n+float lastDUSTPM25 =0.0;\n+float valDUSTPM10 =0.0;\n+float lastDUSTPM10 =0.0;\n+unsigned long duration;\n+unsigned long starttime;\n+unsigned long endtime;\n+unsigned long sampletime_ms = 30000;\n+unsigned long lowpulseoccupancy = 0;\n+float ratio = 0;\n+long concentrationPM25 = 0;\n+long concentrationPM10 = 0;\n+\n+MySensor gw;\n+MyMessage dustMsgPM10(CHILD_ID_DUST_PM10, V_DUST_LEVEL);","path":"libraries/MySensors/examples/DustSensor/DustSensor_SamYoung_DSM501.ino","position":41,"original_position":41,"commit_id":"9fc4e794b023c209261142e92f95f3f10b0a01fc","original_commit_id":"a671d8eed8a9041d83928d93f27b07cde2434df2","user":{"login":"henrikekblad","id":5717075,"avatar_url":"https://avatars.githubusercontent.com/u/5717075?v=3","gravatar_id":"","url":"https://api.github.com/users/henrikekblad","html_url":"https://github.com/henrikekblad","followers_url":"https://api.github.com/users/henrikekblad/followers","following_url":"https://api.github.com/users/henrikekblad/following{/other_user}","gists_url":"https://api.github.com/users/henrikekblad/gists{/gist_id}","starred_url":"https://api.github.com/users/henrikekblad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henrikekblad/subscriptions","organizations_url":"https://api.github.com/users/henrikekblad/orgs","repos_url":"https://api.github.com/users/henrikekblad/repos","events_url":"https://api.github.com/users/henrikekblad/events{/privacy}","received_events_url":"https://api.github.com/users/henrikekblad/received_events","type":"User","site_admin":false},"body":"This is called V_LEVEL now. \r\nAnd if possible send a texual V_UNIT_PREFIX (e.g. \"ppm\"). ","created_at":"2015-08-10T18:42:05Z","updated_at":"2015-08-10T18:42:05Z","html_url":"https://github.com/mysensors/Arduino/pull/164#discussion_r36668465","pull_request_url":"https://api.github.com/repos/mysensors/Arduino/pulls/164","_links":{"self":{"href":"https://api.github.com/repos/mysensors/Arduino/pulls/comments/36668465"},"html":{"href":"https://github.com/mysensors/Arduino/pull/164#discussion_r36668465"},"pull_request":{"href":"https://api.github.com/repos/mysensors/Arduino/pulls/164"}}},"pull_request":{"url":"https://api.github.com/repos/mysensors/Arduino/pulls/164","id":42047140,"html_url":"https://github.com/mysensors/Arduino/pull/164","diff_url":"https://github.com/mysensors/Arduino/pull/164.diff","patch_url":"https://github.com/mysensors/Arduino/pull/164.patch","issue_url":"https://api.github.com/repos/mysensors/Arduino/issues/164","number":164,"state":"closed","locked":false,"title":"new sensors in 1.5","user":{"login":"empierre","id":7287178,"avatar_url":"https://avatars.githubusercontent.com/u/7287178?v=3","gravatar_id":"","url":"https://api.github.com/users/empierre","html_url":"https://github.com/empierre","followers_url":"https://api.github.com/users/empierre/followers","following_url":"https://api.github.com/users/empierre/following{/other_user}","gists_url":"https://api.github.com/users/empierre/gists{/gist_id}","starred_url":"https://api.github.com/users/empierre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/empierre/subscriptions","organizations_url":"https://api.github.com/users/empierre/orgs","repos_url":"https://api.github.com/users/empierre/repos","events_url":"https://api.github.com/users/empierre/events{/privacy}","received_events_url":"https://api.github.com/users/empierre/received_events","type":"User","site_admin":false},"body":"proposal for a decent dust sensor giving ppm in output.","created_at":"2015-08-10T17:54:47Z","updated_at":"2015-08-10T18:42:05Z","closed_at":"2015-08-10T18:34:25Z","merged_at":null,"merge_commit_sha":"5a96b3d2e9577b89da8e6205ae2abc23592506d5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mysensors/Arduino/pulls/164/commits","review_comments_url":"https://api.github.com/repos/mysensors/Arduino/pulls/164/comments","review_comment_url":"https://api.github.com/repos/mysensors/Arduino/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mysensors/Arduino/issues/164/comments","statuses_url":"https://api.github.com/repos/mysensors/Arduino/statuses/9fc4e794b023c209261142e92f95f3f10b0a01fc","head":{"label":"empierre:master","ref":"master","sha":"9fc4e794b023c209261142e92f95f3f10b0a01fc","user":{"login":"empierre","id":7287178,"avatar_url":"https://avatars.githubusercontent.com/u/7287178?v=3","gravatar_id":"","url":"https://api.github.com/users/empierre","html_url":"https://github.com/empierre","followers_url":"https://api.github.com/users/empierre/followers","following_url":"https://api.github.com/users/empierre/following{/other_user}","gists_url":"https://api.github.com/users/empierre/gists{/gist_id}","starred_url":"https://api.github.com/users/empierre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/empierre/subscriptions","organizations_url":"https://api.github.com/users/empierre/orgs","repos_url":"https://api.github.com/users/empierre/repos","events_url":"https://api.github.com/users/empierre/events{/privacy}","received_events_url":"https://api.github.com/users/empierre/received_events","type":"User","site_admin":false},"repo":{"id":24267633,"name":"Arduino-1","full_name":"empierre/Arduino-1","owner":{"login":"empierre","id":7287178,"avatar_url":"https://avatars.githubusercontent.com/u/7287178?v=3","gravatar_id":"","url":"https://api.github.com/users/empierre","html_url":"https://github.com/empierre","followers_url":"https://api.github.com/users/empierre/followers","following_url":"https://api.github.com/users/empierre/following{/other_user}","gists_url":"https://api.github.com/users/empierre/gists{/gist_id}","starred_url":"https://api.github.com/users/empierre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/empierre/subscriptions","organizations_url":"https://api.github.com/users/empierre/orgs","repos_url":"https://api.github.com/users/empierre/repos","events_url":"https://api.github.com/users/empierre/events{/privacy}","received_events_url":"https://api.github.com/users/empierre/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/empierre/Arduino-1","description":"MySensors Arduino Library and examples","fork":true,"url":"https://api.github.com/repos/empierre/Arduino-1","forks_url":"https://api.github.com/repos/empierre/Arduino-1/forks","keys_url":"https://api.github.com/repos/empierre/Arduino-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/empierre/Arduino-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/empierre/Arduino-1/teams","hooks_url":"https://api.github.com/repos/empierre/Arduino-1/hooks","issue_events_url":"https://api.github.com/repos/empierre/Arduino-1/issues/events{/number}","events_url":"https://api.github.com/repos/empierre/Arduino-1/events","assignees_url":"https://api.github.com/repos/empierre/Arduino-1/assignees{/user}","branches_url":"https://api.github.com/repos/empierre/Arduino-1/branches{/branch}","tags_url":"https://api.github.com/repos/empierre/Arduino-1/tags","blobs_url":"https://api.github.com/repos/empierre/Arduino-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/empierre/Arduino-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/empierre/Arduino-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/empierre/Arduino-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/empierre/Arduino-1/statuses/{sha}","languages_url":"https://api.github.com/repos/empierre/Arduino-1/languages","stargazers_url":"https://api.github.com/repos/empierre/Arduino-1/stargazers","contributors_url":"https://api.github.com/repos/empierre/Arduino-1/contributors","subscribers_url":"https://api.github.com/repos/empierre/Arduino-1/subscribers","subscription_url":"https://api.github.com/repos/empierre/Arduino-1/subscription","commits_url":"https://api.github.com/repos/empierre/Arduino-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/empierre/Arduino-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/empierre/Arduino-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/empierre/Arduino-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/empierre/Arduino-1/contents/{+path}","compare_url":"https://api.github.com/repos/empierre/Arduino-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/empierre/Arduino-1/merges","archive_url":"https://api.github.com/repos/empierre/Arduino-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/empierre/Arduino-1/downloads","issues_url":"https://api.github.com/repos/empierre/Arduino-1/issues{/number}","pulls_url":"https://api.github.com/repos/empierre/Arduino-1/pulls{/number}","milestones_url":"https://api.github.com/repos/empierre/Arduino-1/milestones{/number}","notifications_url":"https://api.github.com/repos/empierre/Arduino-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/empierre/Arduino-1/labels{/name}","releases_url":"https://api.github.com/repos/empierre/Arduino-1/releases{/id}","created_at":"2014-09-20T16:19:13Z","updated_at":"2015-08-10T17:52:49Z","pushed_at":"2015-08-10T18:33:10Z","git_url":"git://github.com/empierre/Arduino-1.git","ssh_url":"git@github.com:empierre/Arduino-1.git","clone_url":"https://github.com/empierre/Arduino-1.git","svn_url":"https://github.com/empierre/Arduino-1","homepage":"http://www.mysensors.org","size":3187,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mysensors:master","ref":"master","sha":"d170b7b6ac44304ec45ec221aad0cb6084bcdca5","user":{"login":"mysensors","id":6282844,"avatar_url":"https://avatars.githubusercontent.com/u/6282844?v=3","gravatar_id":"","url":"https://api.github.com/users/mysensors","html_url":"https://github.com/mysensors","followers_url":"https://api.github.com/users/mysensors/followers","following_url":"https://api.github.com/users/mysensors/following{/other_user}","gists_url":"https://api.github.com/users/mysensors/gists{/gist_id}","starred_url":"https://api.github.com/users/mysensors/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysensors/subscriptions","organizations_url":"https://api.github.com/users/mysensors/orgs","repos_url":"https://api.github.com/users/mysensors/repos","events_url":"https://api.github.com/users/mysensors/events{/privacy}","received_events_url":"https://api.github.com/users/mysensors/received_events","type":"Organization","site_admin":false},"repo":{"id":16154093,"name":"Arduino","full_name":"mysensors/Arduino","owner":{"login":"mysensors","id":6282844,"avatar_url":"https://avatars.githubusercontent.com/u/6282844?v=3","gravatar_id":"","url":"https://api.github.com/users/mysensors","html_url":"https://github.com/mysensors","followers_url":"https://api.github.com/users/mysensors/followers","following_url":"https://api.github.com/users/mysensors/following{/other_user}","gists_url":"https://api.github.com/users/mysensors/gists{/gist_id}","starred_url":"https://api.github.com/users/mysensors/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mysensors/subscriptions","organizations_url":"https://api.github.com/users/mysensors/orgs","repos_url":"https://api.github.com/users/mysensors/repos","events_url":"https://api.github.com/users/mysensors/events{/privacy}","received_events_url":"https://api.github.com/users/mysensors/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mysensors/Arduino","description":"MySensors Arduino Library and examples","fork":false,"url":"https://api.github.com/repos/mysensors/Arduino","forks_url":"https://api.github.com/repos/mysensors/Arduino/forks","keys_url":"https://api.github.com/repos/mysensors/Arduino/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mysensors/Arduino/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mysensors/Arduino/teams","hooks_url":"https://api.github.com/repos/mysensors/Arduino/hooks","issue_events_url":"https://api.github.com/repos/mysensors/Arduino/issues/events{/number}","events_url":"https://api.github.com/repos/mysensors/Arduino/events","assignees_url":"https://api.github.com/repos/mysensors/Arduino/assignees{/user}","branches_url":"https://api.github.com/repos/mysensors/Arduino/branches{/branch}","tags_url":"https://api.github.com/repos/mysensors/Arduino/tags","blobs_url":"https://api.github.com/repos/mysensors/Arduino/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mysensors/Arduino/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mysensors/Arduino/git/refs{/sha}","trees_url":"https://api.github.com/repos/mysensors/Arduino/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mysensors/Arduino/statuses/{sha}","languages_url":"https://api.github.com/repos/mysensors/Arduino/languages","stargazers_url":"https://api.github.com/repos/mysensors/Arduino/stargazers","contributors_url":"https://api.github.com/repos/mysensors/Arduino/contributors","subscribers_url":"https://api.github.com/repos/mysensors/Arduino/subscribers","subscription_url":"https://api.github.com/repos/mysensors/Arduino/subscription","commits_url":"https://api.github.com/repos/mysensors/Arduino/commits{/sha}","git_commits_url":"https://api.github.com/repos/mysensors/Arduino/git/commits{/sha}","comments_url":"https://api.github.com/repos/mysensors/Arduino/comments{/number}","issue_comment_url":"https://api.github.com/repos/mysensors/Arduino/issues/comments{/number}","contents_url":"https://api.github.com/repos/mysensors/Arduino/contents/{+path}","compare_url":"https://api.github.com/repos/mysensors/Arduino/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mysensors/Arduino/merges","archive_url":"https://api.github.com/repos/mysensors/Arduino/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mysensors/Arduino/downloads","issues_url":"https://api.github.com/repos/mysensors/Arduino/issues{/number}","pulls_url":"https://api.github.com/repos/mysensors/Arduino/pulls{/number}","milestones_url":"https://api.github.com/repos/mysensors/Arduino/milestones{/number}","notifications_url":"https://api.github.com/repos/mysensors/Arduino/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mysensors/Arduino/labels{/name}","releases_url":"https://api.github.com/repos/mysensors/Arduino/releases{/id}","created_at":"2014-01-22T22:06:31Z","updated_at":"2015-08-09T21:31:02Z","pushed_at":"2015-08-10T18:33:11Z","git_url":"git://github.com/mysensors/Arduino.git","ssh_url":"git@github.com:mysensors/Arduino.git","clone_url":"https://github.com/mysensors/Arduino.git","svn_url":"https://github.com/mysensors/Arduino","homepage":"http://www.mysensors.org","size":9801,"stargazers_count":232,"watchers_count":232,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":289,"mirror_url":null,"open_issues_count":4,"forks":289,"open_issues":4,"watchers":232,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mysensors/Arduino/pulls/164"},"html":{"href":"https://github.com/mysensors/Arduino/pull/164"},"issue":{"href":"https://api.github.com/repos/mysensors/Arduino/issues/164"},"comments":{"href":"https://api.github.com/repos/mysensors/Arduino/issues/164/comments"},"review_comments":{"href":"https://api.github.com/repos/mysensors/Arduino/pulls/164/comments"},"review_comment":{"href":"https://api.github.com/repos/mysensors/Arduino/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mysensors/Arduino/pulls/164/commits"},"statuses":{"href":"https://api.github.com/repos/mysensors/Arduino/statuses/9fc4e794b023c209261142e92f95f3f10b0a01fc"}}}}