{"action":"closed","issue":{"url":"https://api.github.com/repos/rakeshpai/pi-gpio/issues/39","labels_url":"https://api.github.com/repos/rakeshpai/pi-gpio/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/rakeshpai/pi-gpio/issues/39/comments","events_url":"https://api.github.com/repos/rakeshpai/pi-gpio/issues/39/events","html_url":"https://github.com/rakeshpai/pi-gpio/issues/39","id":78322594,"number":39,"title":"Using pi-gpio with a photocell","user":{"login":"blinger","id":4709912,"avatar_url":"https://avatars.githubusercontent.com/u/4709912?v=3","gravatar_id":"","url":"https://api.github.com/users/blinger","html_url":"https://github.com/blinger","followers_url":"https://api.github.com/users/blinger/followers","following_url":"https://api.github.com/users/blinger/following{/other_user}","gists_url":"https://api.github.com/users/blinger/gists{/gist_id}","starred_url":"https://api.github.com/users/blinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blinger/subscriptions","organizations_url":"https://api.github.com/users/blinger/orgs","repos_url":"https://api.github.com/users/blinger/repos","events_url":"https://api.github.com/users/blinger/events{/privacy}","received_events_url":"https://api.github.com/users/blinger/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-20T01:32:28Z","updated_at":"2015-05-20T05:40:11Z","closed_at":"2015-05-20T05:40:11Z","body":"Is pi-gpio capable of returning a value from a photocell? basically trying to do something like this, but in node.\r\n```\r\n#!/usr/bin/env python\r\n \r\nimport RPi.GPIO as GPIO, time, os\r\n \r\nDEBUG = 1\r\nGPIO.setmode(GPIO.BCM)\r\n \r\ndef RCtime (RCpin):\r\n    reading = 0\r\n    GPIO.setup(RCpin, GPIO.OUT)\r\n    GPIO.output(RCpin, GPIO.LOW)\r\n    time.sleep(0.1)\r\n \r\n    GPIO.setup(RCpin, GPIO.IN)\r\n    # This takes about 1 millisecond per loop cycle\r\n    while (GPIO.input(RCpin) == GPIO.LOW):\r\n        reading += 1\r\n    return reading\r\n \r\nwhile True:\r\n    print RCtime(18) # Read RC timing using pin #18\r\n```"}}