{"_id":"pi-gpio","_rev":"66-a721ef40cf349bcd98e57081610c51df","name":"pi-gpio","dist-tags":{"latest":"0.0.8"},"versions":{"0.0.1":{"name":"pi-gpio","version":"0.0.1","author":{"name":"Rakesh Pai","email":"rakeshpai@gmail.com"},"_id":"pi-gpio@0.0.1","maintainers":[{"name":"rakeshpai","email":"rakeshpai@gmail.com"}],"homepage":"https://github.com/rakeshpai/pi-gpio","bugs":{"url":"https://github.com/rakeshpai/pi-gpio/issues"},"dist":{"shasum":"117fdf0c0961d9b88d959af55643e1e2b5c43d36","tarball":"https://registry.npmjs.org/pi-gpio/-/pi-gpio-0.0.1.tgz","integrity":"sha512-jQDXUYNZPIzyf8lY/+6sbRNFBtY31lFquatn5g0YjkfNEn4fjcm9Br20ZHAZL/7eAit30vfl2jftwfuiFFpfKQ==","signatures":[{"sig":"MEYCIQCimvSsXQ6AzETwUHAr+ezc+xCDYBLwD402zZK9U610WAIhAJoGHyh6jjjHpxRY9OdafAv/EYC41lYYJFf8uDAIUOsT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./pi-gpio","tags":["raspberry","pi","gpio","simple"],"engines":{"node":"*"},"scripts":{"test":"mocha --reporter spec"},"_npmUser":{"name":"rakeshpai","email":"rakeshpai@gmail.com"},"repository":{"url":"git@github.com:rakeshpai/pi-gpio.git","type":"git"},"_npmVersion":"1.1.4","description":"A simple node.js-based GPIO helper for the Raspberry Pi","directories":{},"_nodeVersion":"v0.6.19","dependencies":{},"_defaultsLoaded":true,"devDependencies":{"mocha":"1.x","should":"1.x"},"_engineSupported":true,"optionalDependencies":{}},"0.0.2":{"name":"pi-gpio","version":"0.0.2","author":{"name":"Rakesh Pai","email":"rakeshpai@gmail.com"},"_id":"pi-gpio@0.0.2","maintainers":[{"name":"rakeshpai","email":"rakeshpai@gmail.com"}],"homepage":"https://github.com/rakeshpai/pi-gpio","bugs":{"url":"https://github.com/rakeshpai/pi-gpio/issues"},"dist":{"shasum":"08cc0d426dae253149ab5b01d686db7cb3c4a3ca","tarball":"https://registry.npmjs.org/pi-gpio/-/pi-gpio-0.0.2.tgz","integrity":"sha512-AH/8/EPbbCQnvKugXqcCq5Y+DGhilpgjCQpqdUtpsL7UBjoGFcQyOvTIetYxx7Zn/Eg6UiJI8cNAPs4LErpK7g==","signatures":[{"sig":"MEYCIQCq2NLHa3iF59NGBap1lwmsnSvRuYaJ8sQe/N+NsjUOmAIhANvJjYiJbjeZzx53oQTzUB/WsArbH/ZdiN0JEcA5qU2C","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./pi-gpio","tags":["raspberry","pi","gpio","simple"],"engines":{"node":"*"},"scripts":{"test":"mocha --reporter spec"},"_npmUser":{"name":"rakeshpai","email":"rakeshpai@gmail.com"},"repository":{"url":"git@github.com:rakeshpai/pi-gpio.git","type":"git"},"_npmVersion":"1.1.4","description":"A simple node.js-based GPIO helper for the Raspberry Pi","directories":{},"_nodeVersion":"v0.6.19","dependencies":{},"_defaultsLoaded":true,"devDependencies":{"mocha":"1.x","should":"1.x"},"_engineSupported":true,"optionalDependencies":{}},"0.0.3":{"name":"pi-gpio","version":"0.0.3","author":{"name":"Rakesh Pai","email":"rakeshpai@gmail.com"},"_id":"pi-gpio@0.0.3","maintainers":[{"name":"rakeshpai","email":"rakeshpai@gmail.com"}],"homepage":"https://github.com/rakeshpai/pi-gpio","bugs":{"url":"https://github.com/rakeshpai/pi-gpio/issues"},"dist":{"shasum":"fcfad113d1cc77d13850e2004a6ba8eb450e5b54","tarball":"https://registry.npmjs.org/pi-gpio/-/pi-gpio-0.0.3.tgz","integrity":"sha512-TWn4PCW99hoD9OLB3ezWqsiJYvhKMp3IRtH/nfZNofaV19SONbrIKB3xWrW7v/gzVg1BBSWnCujhgAfBJ5fU6A==","signatures":[{"sig":"MEUCIQD2L5FyyEQw2HvBwB2ozof5FjaQJz2QGXjtjd7G0lCOQQIgRueEGEaxUCArlFmy1txdZuhHKD/B9ts0Cjxt1/YEpFw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./pi-gpio","tags":["raspberry","pi","gpio","simple"],"_from":".","engines":{"node":"*"},"scripts":{"test":"mocha --reporter spec"},"_npmUser":{"name":"rakeshpai","email":"rakeshpai@gmail.com"},"repository":{"url":"git@github.com:rakeshpai/pi-gpio.git","type":"git"},"_npmVersion":"1.4.3","description":"A simple node.js-based GPIO helper for the Raspberry Pi","directories":{},"dependencies":{},"devDependencies":{"mocha":"1.x","should":"1.x"},"optionalDependencies":{}},"0.0.4":{"name":"pi-gpio","version":"0.0.4","author":{"name":"Rakesh Pai","email":"rakeshpai@gmail.com"},"_id":"pi-gpio@0.0.4","maintainers":[{"name":"rakeshpai","email":"rakeshpai@gmail.com"}],"homepage":"https://github.com/rakeshpai/pi-gpio","bugs":{"url":"https://github.com/rakeshpai/pi-gpio/issues"},"dist":{"shasum":"867bebd80d0980e55f908fae6fb00f171b0342ba","tarball":"https://registry.npmjs.org/pi-gpio/-/pi-gpio-0.0.4.tgz","integrity":"sha512-w/+UsRzJnngQbR20Y5LAhdJlzF+IJoW7zOUXIcHDkatmJM5iBTYKxP0VGRVWxmtYIxKB6G2hACTCjAKAubvpEQ==","signatures":[{"sig":"MEYCIQDEU6vPQEJsJX1XDiI20zNQev/UWeXYbZL8uu6Pgdi2TQIhAP1dl5bSskTA1zjG78HdmajqLiZQeDKNhl4dwJhpsPi7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./pi-gpio","tags":["raspberry","pi","gpio","simple"],"_from":".","engines":{"node":"*"},"scripts":{"test":"mocha --reporter spec"},"_npmUser":{"name":"rakeshpai","email":"rakeshpai@gmail.com"},"repository":{"url":"git@github.com:rakeshpai/pi-gpio.git","type":"git"},"_npmVersion":"1.4.3","description":"A simple node.js-based GPIO helper for the Raspberry Pi","directories":{},"dependencies":{},"devDependencies":{"mocha":"1.x","should":"1.x"},"optionalDependencies":{}},"0.0.5":{"name":"pi-gpio","version":"0.0.5","author":{"name":"Rakesh Pai","email":"rakeshpai@gmail.com"},"_id":"pi-gpio@0.0.5","maintainers":[{"name":"rakeshpai","email":"rakeshpai@gmail.com"}],"homepage":"https://github.com/rakeshpai/pi-gpio","bugs":{"url":"https://github.com/rakeshpai/pi-gpio/issues"},"dist":{"shasum":"24ecceab44d2b599d9e8462f6321404e39e742be","tarball":"https://registry.npmjs.org/pi-gpio/-/pi-gpio-0.0.5.tgz","integrity":"sha512-+UJpVP4A9ZBcj1FsvZEQRxohtIdFxu1tHiiuBWyvp/DZRpwwt7hsSBwLVxqzA94QCFuFNdLJJkyKkz/U+fJK2A==","signatures":[{"sig":"MEUCIQC2xkxa0p7H1ZcCztmw1+ooZjvXm5emIuExAkEzSPIQRwIgPsh4CXkZDOyYFX+H1W423pMnjjEkfKmdtc0Jumhd5pQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./pi-gpio","tags":["raspberry","pi","gpio","simple"],"_from":".","engines":{"node":"*"},"scripts":{"test":"mocha --reporter spec"},"_npmUser":{"name":"rakeshpai","email":"rakeshpai@gmail.com"},"repository":{"url":"git@github.com:rakeshpai/pi-gpio.git","type":"git"},"_npmVersion":"1.4.3","description":"A simple node.js-based GPIO helper for the Raspberry Pi","directories":{},"dependencies":{},"devDependencies":{"mocha":"1.x","should":"1.x"},"optionalDependencies":{}},"0.0.6":{"name":"pi-gpio","version":"0.0.6","author":{"name":"Rakesh Pai","email":"rakeshpai@gmail.com"},"_id":"pi-gpio@0.0.6","maintainers":[{"name":"rakeshpai","email":"rakeshpai@gmail.com"}],"homepage":"https://github.com/rakeshpai/pi-gpio","bugs":{"url":"https://github.com/rakeshpai/pi-gpio/issues"},"dist":{"shasum":"c48ca9c5b58e86a85042bc14dc66ea2e33bfd5a2","tarball":"https://registry.npmjs.org/pi-gpio/-/pi-gpio-0.0.6.tgz","integrity":"sha512-aZTQJmJqymehl9i+o8lHgYhhIcNjS3L1zMho4eImvtBUEU+ZtWDdYPbF/ah0Z9fd9wQNbXOw4Lvq130hoiwqBA==","signatures":[{"sig":"MEYCIQCbFlKwc+iigaFgazOcM2kGpeHm38+SbwvGrb+Yz/7wCgIhANxWmCIbxouLBx5+C6HLxuTzLqWyrBaeDpLpFt/0h8xD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./pi-gpio","tags":["raspberry","pi","gpio","simple"],"_from":".","engines":{"node":"*"},"scripts":{"test":"mocha --reporter spec"},"_npmUser":{"name":"rakeshpai","email":"rakeshpai@errorception.com"},"repository":{"url":"git@github.com:rakeshpai/pi-gpio.git","type":"git"},"_npmVersion":"1.3.26","description":"A simple node.js-based GPIO helper for the Raspberry Pi","directories":{},"dependencies":{},"devDependencies":{"mocha":"1.x","should":"1.x"},"optionalDependencies":{}},"0.0.7":{"name":"pi-gpio","version":"0.0.7","author":{"name":"Rakesh Pai","email":"rakeshpai@gmail.com"},"_id":"pi-gpio@0.0.7","maintainers":[{"name":"rakeshpai","email":"rakeshpai@gmail.com"}],"homepage":"https://github.com/rakeshpai/pi-gpio","bugs":{"url":"https://github.com/rakeshpai/pi-gpio/issues"},"dist":{"shasum":"83762ca63b0a8916142e344f91db61cf2631ad18","tarball":"https://registry.npmjs.org/pi-gpio/-/pi-gpio-0.0.7.tgz","integrity":"sha512-15Q/Fn9xuhNb0oGxOmrPoukKRACtDn4Ce1VUoZegl+d/mwACB993VuqIBVU0LhZgAys74MxQeKR2xcTGn/DWiQ==","signatures":[{"sig":"MEQCIFQ0BpvqFuy3LrOfiihmheRzMvOxileyGF2kZj5nwLWZAiBo8+ZFV1jXfSwLs9sE1pYWlYXcQpIChleXpn6MbLX49g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./pi-gpio","tags":["raspberry","pi","gpio","simple"],"_from":".","_shasum":"83762ca63b0a8916142e344f91db61cf2631ad18","engines":{"node":"*"},"gitHead":"afc55dded1c41f08ce182d1c1ce3d1bc36d92260","scripts":{"test":"mocha --reporter spec"},"_npmUser":{"name":"rakeshpai","email":"rakeshpai@errorception.com"},"repository":{"url":"git@github.com:rakeshpai/pi-gpio.git","type":"git"},"_npmVersion":"2.7.4","description":"A simple node.js-based GPIO helper for the Raspberry Pi","directories":{},"_nodeVersion":"0.10.25","dependencies":{},"devDependencies":{"mocha":"1.x","should":"1.x"},"optionalDependencies":{}},"0.0.8":{"name":"pi-gpio","version":"0.0.8","author":{"name":"Rakesh Pai","email":"rakeshpai@gmail.com"},"_id":"pi-gpio@0.0.8","maintainers":[{"name":"rakeshpai","email":"rakeshpai@gmail.com"}],"homepage":"https://github.com/rakeshpai/pi-gpio","bugs":{"url":"https://github.com/rakeshpai/pi-gpio/issues"},"dist":{"shasum":"85636bd59c8aa6002671206aa372f57f3f2c3d54","tarball":"https://registry.npmjs.org/pi-gpio/-/pi-gpio-0.0.8.tgz","integrity":"sha512-OUOVsarTNgysYI1Ksvn6v74mHE7ObY8U/1ssTOdFP7SgHubhLv3QrGCJHhoSTXVN7uaD9Ao08iM7+XEh5q8l/A==","signatures":[{"sig":"MEUCIQDtanBrTTFRC4V58TZm2OlxjsBWgLMmmPr0e8pWFTZYYAIgSTPpSDM5k/PdLxv89X/sSRhFAVzH0jx2mH3stkcoyoY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./pi-gpio","tags":["raspberry","pi","gpio","simple"],"_from":".","_shasum":"85636bd59c8aa6002671206aa372f57f3f2c3d54","engines":{"node":"*"},"gitHead":"065401269ee92e7af8ee981aaa5de5c9cbee6090","scripts":{"test":"mocha --reporter spec"},"_npmUser":{"name":"rakeshpai","email":"rakeshpai@errorception.com"},"repository":{"url":"git+ssh://git@github.com/rakeshpai/pi-gpio.git","type":"git"},"_npmVersion":"2.14.2","description":"A simple node.js-based GPIO helper for the Raspberry Pi","directories":{},"_nodeVersion":"4.0.0","dependencies":{},"devDependencies":{"mocha":"1.x","should":"1.x"},"optionalDependencies":{}}},"time":{"created":"2012-08-30T18:18:10.982Z","modified":"2025-05-08T13:13:10.714Z","0.0.1":"2012-08-30T18:18:15.709Z","0.0.2":"2012-09-21T06:08:01.852Z","0.0.3":"2014-04-08T17:47:18.162Z","0.0.4":"2014-04-09T13:36:14.133Z","0.0.5":"2014-04-09T13:40:35.899Z","0.0.6":"2014-07-15T07:26:47.313Z","0.0.7":"2015-04-03T07:38:05.330Z","0.0.8":"2015-10-01T04:20:59.680Z"},"bugs":{"url":"https://github.com/rakeshpai/pi-gpio/issues"},"author":{"name":"Rakesh Pai","email":"rakeshpai@gmail.com"},"homepage":"https://github.com/rakeshpai/pi-gpio","repository":{"url":"git+ssh://git@github.com/rakeshpai/pi-gpio.git","type":"git"},"description":"A simple node.js-based GPIO helper for the Raspberry Pi","maintainers":[{"name":"rakeshpai","email":"rakeshpai@gmail.com"}],"readme":"pi-gpio\n=======\n\npi-gpio is a simple node.js based library to help access the GPIO of the Raspberry Pi (Debian Wheezy). It's modelled loosely around the built-in ``fs`` module.  \nIt works with:\n* original Raspberry Pi (A and B)\n* model B revision 2 boards\n* Raspberry Pi Model A+\n* Raspberry Pi Model B+\n\n```javascript\nvar gpio = require(\"pi-gpio\");\n\ngpio.open(16, \"output\", function(err) {\t\t// Open pin 16 for output\n\tgpio.write(16, 1, function() {\t\t\t// Set pin 16 high (1)\n\t\tgpio.close(16);\t\t\t\t\t\t// Close pin 16\n\t});\n});\n```\n\n## How you can help\n\nWays you can help:\n\n    - Review the pull requests and test them on a Pi for correctness.\n    - Report Bugs.\n    - Fix a bug or add something awesome, Send a pull request.\n\n## About the pin configuration\n\nThis couldn't have been more confusing. Raspberry Pi's physical pins are not laid out in any particular logical order. Most of them are given the names of the pins of the Broadcom chip it uses (BCM2835). There isn't even a logical relationship between the physical layout of the Raspberry Pi pin header and the Broadcom chip's pinout. The OS recognizes the names of the Broadcom chip and has nothing to do with the physical pin layout on the Pi. To add to the fun, the specs for the Broadcom chip are nearly impossible to get!\n\nThis library simplifies all of this (hopefully), by abstracting away the Broadcom chip details. You only need to refer to the pins as they are on the physical pin layout on the Raspberry PI. For your reference, the pin layout follows. All the pins marked \"GPIO\" can be used with this library, using pin numbers as below.\n\n<table>\n\t<tr>\n\t\t<td>\n\t\t\tP1 - 3.3v\n\t\t</td>\n\t\t<td>\n\t\t\t1\n\t\t</td>\n\t\t<td>\n\t\t\t2\n\t\t</td>\n\t\t<td>\n\t\t\t5v\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\tI2C SDA\n\t\t</td>\n\t\t<td>\n\t\t\t3\n\t\t</td>\n\t\t<td >\n\t\t\t4\n\t\t</td>\n\t\t<td>\n\t\t\t--\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\tI2C SCL\n\t\t</td>\n\t\t<td>\n\t\t\t5\n\t\t</td>\n\t\t<td>\n\t\t\t6\n\t\t</td>\n\t\t<td>\n\t\t\tGround\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\tGPIO\n\t\t</td>\n\t\t<td>\n\t\t\t7\n\t\t</td>\n\t\t<td>\n\t\t\t8\n\t\t</td>\n\t\t<td>\n\t\t\tTX\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\t--\n\t\t</td>\n\t\t<td>\n\t\t\t9\n\t\t</td>\n\t\t<td>\n\t\t\t10\n\t\t</td>\n\t\t<td>\n\t\t\tRX\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\tGPIO\n\t\t</td>\n\t\t<td>\n\t\t\t11\n\t\t</td>\n\t\t<td>\n\t\t\t12\n\t\t</td>\n\t\t<td>\n\t\t\tGPIO\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\tGPIO\n\t\t</td>\n\t\t<td>\n\t\t\t13\n\t\t</td>\n\t\t<td>\n\t\t\t14\n\t\t</td>\n\t\t<td>\n\t\t\t--\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\tGPIO\n\t\t</td>\n\t\t<td>\n\t\t\t15\n\t\t</td>\n\t\t<td>\n\t\t\t16\n\t\t</td>\n\t\t<td>\n\t\t\tGPIO\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\t--\n\t\t</td>\n\t\t<td>\n\t\t\t17\n\t\t</td>\n\t\t<td>\n\t\t\t18\n\t\t</td>\n\t\t<td>\n\t\t\tGPIO\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\tSPI MOSI\n\t\t</td>\n\t\t<td>\n\t\t\t19\n\t\t</td>\n\t\t<td>\n\t\t\t20\n\t\t</td>\n\t\t<td>\n\t\t\t--\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\tSPI MISO\n\t\t</td>\n\t\t<td>\n\t\t\t21\n\t\t</td>\n\t\t<td>\n\t\t\t22\n\t\t</td>\n\t\t<td>\n\t\t\tGPIO\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\tSPI SCLK\n\t\t</td>\n\t\t<td>\n\t\t\t23\n\t\t</td>\n\t\t<td>\n\t\t\t24\n\t\t</td>\n\t\t<td>\n\t\t\tSPI CE0\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\t--\n\t\t</td>\n\t\t<td>\n\t\t\t25\n\t\t</td>\n\t\t<td>\n\t\t\t26\n\t\t</td>\n\t\t<td>\n\t\t\tSPI CE1\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=\"4\">Model A+ and Model B+ additional pins</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\tID_SD\n\t\t</td>\n\t\t<td>\n\t\t\t27\n\t\t</td>\n\t\t<td>\n\t\t\t28\n\t\t</td>\n\t\t<td>\n\t\t\tID_SC\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\tGPIO\n\t\t</td>\n\t\t<td>\n\t\t\t29\n\t\t</td>\n\t\t<td>\n\t\t\t30\n\t\t</td>\n\t\t<td>\n\t\t\t--\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\tGPIO\n\t\t</td>\n\t\t<td>\n\t\t\t31\n\t\t</td>\n\t\t<td>\n\t\t\t32\n\t\t</td>\n\t\t<td>\n\t\t\tGPIO\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\tGPIO\n\t\t</td>\n\t\t<td>\n\t\t\t33\n\t\t</td>\n\t\t<td>\n\t\t\t34\n\t\t</td>\n\t\t<td>\n\t\t\t--\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\tGPIO\n\t\t</td>\n\t\t<td>\n\t\t\t35\n\t\t</td>\n\t\t<td>\n\t\t\t36\n\t\t</td>\n\t\t<td>\n\t\t\tGPIO\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\tGPIO\n\t\t</td>\n\t\t<td>\n\t\t\t37\n\t\t</td>\n\t\t<td>\n\t\t\t38\n\t\t</td>\n\t\t<td>\n\t\t\tGPIO\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td>\n\t\t\t--\n\t\t</td>\n\t\t<td>\n\t\t\t39\n\t\t</td>\n\t\t<td>\n\t\t\t40\n\t\t</td>\n\t\t<td>\n\t\t\tGPIO\n\t\t</td>\n\t</tr>\n</table>\n\nThat gives you several GPIO pins to play with: pins 7, 11, 12, 13, 15, 16, 18 and 22 (with A+ and B+ giving 29, 31, 32, 33, 35, 37, 38 and 40). You should provide these physical pin numbers to this library, and not bother with what they are called internally. Easy-peasy.\n\n## Installation\n\nIf you haven't already, get node and npm on the Pi. The simplest way is:\n\n\tsudo apt-get install nodejs npm\n\nThe Raspberry Pi's GPIO pins require you to be root to access them. That's totally unsafe for several reasons. To get around this problem, you should use the excellent [gpio-admin](https://github.com/quick2wire/quick2wire-gpio-admin).\n\nDo the following on your raspberry pi:\n\n\tgit clone git://github.com/quick2wire/quick2wire-gpio-admin.git\n\tcd quick2wire-gpio-admin\n\tmake\n\tsudo make install\n\tsudo adduser $USER gpio\n\nAfter this, you will need to logout and log back in. [Details](http://quick2wire.com/2012/05/safe-controlled-access-to-gpio-on-the-raspberry-pi/), if you are interested.\n\nNext, ``cd`` to your project directory and use npm to install pi-gpio in your project.\n\n\tnpm install pi-gpio\n\nThat's it!\n\n## Usage\n\n### .open(pinNumber, [options], [callback])\n\nAliased to ``.export``\n\nMakes ``pinNumber`` available for use. \n\n* ``pinNumber``: The pin number to make available. Remember, ``pinNumber`` is the physical pin number on the Pi. \n* ``options``: (Optional) Should be a string, such as ``input`` or ``input pullup``. You can specify whether the pin direction should be `input` or `output` (or `in` or `out`). You can additionally set the internal pullup / pulldown resistor by sepcifying `pullup` or `pulldown` (or `up` or `down`). If options isn't provided, it defaults to `output`. If a direction (`input` or `output`) is not specified (eg. only `up`), then the direction defaults to `output`.\n* ``callback``: (Optional) Will be called when the pin is available for use. May receive an error as the first argument if something went wrong.\n\n### .close(pinNumber, [callback])\n\nAliased to ``.unexport``\n\nCloses ``pinNumber``.\n\n* ``pinNumber``: The pin number to close. Again, ``pinNumber`` is the physical pin number on the Pi.\n* ``callback``: (Optional) Will be called when the pin is closed. Again, may receive an error as the first argument.\n\n### .setDirection(pinNumber, direction, [callback])\n\nChanges the direction from ``input`` to ``output`` or vice-versa.\n\n* ``pinNumber``: As usual.\n* ``direction``: Either ``input`` or ``in`` or ``output`` or ``out``.\n* ``callback``: Will be called when direction change is complete. May receive an error as usual.\n\n### .getDirection(pinNumber, [callback])\n\nGets the direction of the pin. Acts like a getter for the method above.\n\n* ``pinNumber``: As usual\n* ``callback``: Will be called when the direction is received. The first argument could be an error. The second argument will either be ``in`` or ``out``. \n\n### .read(pinNumber, [callback])\n\nReads the current value of the pin. Most useful if the pin is in the ``input`` direction.\n\n* ``pinNumber``: As usual.\n* ``callback``: Will receive a possible error object as the first argument, and the value of the pin as the second argument. The value will be either ``0`` or ``1`` (numeric).\n\nExample:\n```javascript\ngpio.read(16, function(err, value) {\n\tif(err) throw err;\n\tconsole.log(value);\t// The current state of the pin\n});\n```\n\n### .write(pinNumber, value, [callback])\n\nWrites ``value`` to ``pinNumber``. Will obviously fail if the pin is not in the ``output`` direction.\n\n* ``pinNumber``: As usual.\n* ``value``: Should be either a numeric ``0`` or ``1``. Any value that isn't ``0`` or ``1`` will be coerced to be boolean, and then converted to 0 (false) or 1 (true). Just stick to sending a numeric 0 or 1, will you? ;)\n* ``callback``: Will be called when the value is set. Again, might receive an error.\n\n## Misc\n\n* To run tests: ``npm install && npm test`` where you've got the checkout.\n* This module was created, ``git push``'ed and ``npm publish``'ed all from the Raspberry Pi! The Pi rocks!\n\n## Coming soon\n\n* Support for I2C and SPI (though it should already be possible to bit-bang the SPI protocol).\n* Any other suggestions?\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2012 Rakesh Pai <rakeshpai@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","users":{"bbfy":true,"kwan":true,"mrxf":true,"subso":true,"buzuli":true,"esenor":true,"tarcio":true,"didelco":true,"io2work":true,"tophsic":true,"borgaard":true,"crowelch":true,"entozoon":true,"gazzwi86":true,"peterhel":true,"waynekim":true,"developit":true,"earthican":true,"kappuccino":true,"reggionick":true,"samwarmuth":true,"pickledonion":true,"rogerioadris":true,"andrewconnell":true,"cubiclejockey":true,"curioussavage":true,"dewang-mistry":true,"ryanthejuggler":true,"andygreenegrass":true,"nguyenxuantruong.dev":true}}