{"action":"created","issue":{"url":"https://api.github.com/repos/Pitt-RAS/sumo_revamp/issues/2","repository_url":"https://api.github.com/repos/Pitt-RAS/sumo_revamp","labels_url":"https://api.github.com/repos/Pitt-RAS/sumo_revamp/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/Pitt-RAS/sumo_revamp/issues/2/comments","events_url":"https://api.github.com/repos/Pitt-RAS/sumo_revamp/issues/2/events","html_url":"https://github.com/Pitt-RAS/sumo_revamp/issues/2","id":141153594,"number":2,"title":"Prox Sensor Logic","user":{"login":"bcontino","id":13265051,"avatar_url":"https://avatars.githubusercontent.com/u/13265051?v=3","gravatar_id":"","url":"https://api.github.com/users/bcontino","html_url":"https://github.com/bcontino","followers_url":"https://api.github.com/users/bcontino/followers","following_url":"https://api.github.com/users/bcontino/following{/other_user}","gists_url":"https://api.github.com/users/bcontino/gists{/gist_id}","starred_url":"https://api.github.com/users/bcontino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcontino/subscriptions","organizations_url":"https://api.github.com/users/bcontino/orgs","repos_url":"https://api.github.com/users/bcontino/repos","events_url":"https://api.github.com/users/bcontino/events{/privacy}","received_events_url":"https://api.github.com/users/bcontino/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-03-16T02:25:13Z","updated_at":"2016-03-16T16:46:39Z","closed_at":null,"body":"Optimize logic in proximity_sensing.cpp\r\nCondense/remove if statements\r\nNaming conventions on sensor vars"},"comment":{"url":"https://api.github.com/repos/Pitt-RAS/sumo_revamp/issues/comments/197418189","html_url":"https://github.com/Pitt-RAS/sumo_revamp/issues/2#issuecomment-197418189","issue_url":"https://api.github.com/repos/Pitt-RAS/sumo_revamp/issues/2","id":197418189,"user":{"login":"aftersomemath","id":6125615,"avatar_url":"https://avatars.githubusercontent.com/u/6125615?v=3","gravatar_id":"","url":"https://api.github.com/users/aftersomemath","html_url":"https://github.com/aftersomemath","followers_url":"https://api.github.com/users/aftersomemath/followers","following_url":"https://api.github.com/users/aftersomemath/following{/other_user}","gists_url":"https://api.github.com/users/aftersomemath/gists{/gist_id}","starred_url":"https://api.github.com/users/aftersomemath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aftersomemath/subscriptions","organizations_url":"https://api.github.com/users/aftersomemath/orgs","repos_url":"https://api.github.com/users/aftersomemath/repos","events_url":"https://api.github.com/users/aftersomemath/events{/privacy}","received_events_url":"https://api.github.com/users/aftersomemath/received_events","type":"User","site_admin":false},"created_at":"2016-03-16T16:46:39Z","updated_at":"2016-03-16T16:46:39Z","body":"Could we then  do this with an array of pins instead of naming each sensor pin. So our algorithm will look like this:\r\n\r\n`\r\nfloat average = 0;\r\n//Read in all sensor pins and place them in an unit8\r\nunsigned int sensors[NUM_SENSORS] = //Read in all sensor pins place there outputs in an array of an unsigned int for speed\r\nfor(int i = 0; i < NUM_SENSORS; i++){\r\n     if(sensors[i] == 1){\r\n          average += sensor_error_weight[i]\r\n     }\r\n}\r\naverage = average / (float)NUM_SENSORS;\r\nreturn average // average will then be used \r\n`\r\n\r\nThis does not handle the case where we choose whether to move backwards or forwards however, I think we should just ignore the back sensors if the front sensors are picking anything up."}}