{"_id":"simplespi","_rev":"10-89503556a82eeb9c6e0d4c51ee97095b","name":"simplespi","description":"a simple and easy to use SPI interface for node.js (for raspberry pi etc)","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"simplespi","version":"0.0.1","description":"a simple and easy to use SPI interface for node.js (for raspberry pi etc)","main":"build/Release/simplespi.node","scripts":{"test":"echo \"Error: no test specified\" && exit 1","install":"node-gyp rebuild"},"homepage":"https://github.com/fjw/node-simplespi","repository":{"type":"git","url":"https://github.com/fjw/node-simplespi.git"},"keywords":["spi","raspberry","pi","raspberrypi","rpi","adafruit","led","pwm"],"author":{"name":"Frédéric Worm"},"license":"MIT","readmeFilename":"README.md","gypfile":true,"readme":"node-simplespi\n==============\n\nThis is a simple and easy to use **SPI** module for **node.js**.\n\nI wrote this to have an easy way to control a **Adafruit PWM LED driver** with my **Raspberry Pi** ( [node-leddriver](https://github.com/fjw/node-leddriver) ), but it **should also work with different clients and hosts**.\n\n### Installation\n\n```sh\nnpm install simplespi\n```\n\n### Usage\n\n```js\nvar simplespi = require( \"simplespi\" );\n\nvar response = simplespi.send( \"AA00FF\", \"/dev/spidev0.1\" );\n```\n\nThe `send` method accepts a hexcode string as parameter and sends it to the SPI device defined in the optional second parameter.\nIf the second parameter is undefined it uses `/dev/spidev0.0`.\n\nThe value returned is the response of the device in hexcode string form.\n\n### Testing on the Pi\n\nFirst run the following on your Raspberry Pi (with `root` privileges):\n```js\nconsole.log(simplespi.send( \"AA00FF\" ));\n```\nIt should return:\n```\n000000\n```\nThen shortcut the `MISO` and `MOSI` pins of your pi and run the same command again.\nIt should then return:\n```\nAA00FF\n```\nIf you got this your SPI device is working.\n\n### Enabling SPI on the Pi\n\nIf it's still not working, check your `/etc/modprobe.d/raspi-blacklist.conf` and comment out the entry:\n```\nblacklist spi-bcm2708\n```\nby changing it to:\n```\n#blacklist spi-bcm2708\n```\nthen reboot your pi and type `ls /dev`.\nIf `spidev0.0` is in the list you're fine and you can repeat the test.","_id":"simplespi@0.0.1","dist":{"shasum":"53ad2bc25d4f1c1e6767a802cb33b84a8b4a66c1","tarball":"https://registry.npmjs.org/simplespi/-/simplespi-0.0.1.tgz","integrity":"sha512-vNovCukTljvqfHPI0kcDQe3ZHq+G87K1NFaXiAzCs93Bzr+ysu+XkgGwj/5OW8TBVY1FM/pMzReFUkL+1lCl9Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFVlWZR3NoSbphMm17BH1WehfzdYKPhPBwM157M1b7QnAiEAuN1oQSeS3Ebm3ngvtXJf61uteBxitTEAVKIEImw4jnU="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"fjw","email":"fjw@garx.de"},"maintainers":[{"name":"fjw","email":"fjw@garx.de"}]}},"readme":"node-simplespi\n==============\n\nThis is a simple and easy to use **SPI** module for **node.js**.\n\nI wrote this to have an easy way to control a **Adafruit PWM LED driver** with my **Raspberry Pi** ( [node-leddriver](https://github.com/fjw/node-leddriver) ), but it **should also work with different clients and hosts**.\n\n### Installation\n\n```sh\nnpm install simplespi\n```\n\n### Usage\n\n```js\nvar simplespi = require( \"simplespi\" );\n\nvar response = simplespi.send( \"AA00FF\", \"/dev/spidev0.1\" );\n```\n\nThe `send` method accepts a hexcode string as parameter and sends it to the SPI device defined in the optional second parameter.\nIf the second parameter is undefined it uses `/dev/spidev0.0`.\n\nThe value returned is the response of the device in hexcode string form.\n\n### Testing on the Pi\n\nFirst run the following on your Raspberry Pi (with `root` privileges):\n```js\nconsole.log(simplespi.send( \"AA00FF\" ));\n```\nIt should return:\n```\n000000\n```\nThen shortcut the `MISO` and `MOSI` pins of your pi and run the same command again.\nIt should then return:\n```\nAA00FF\n```\nIf you got this your SPI device is working.\n\n### Enabling SPI on the Pi\n\nIf it's still not working, check your `/etc/modprobe.d/raspi-blacklist.conf` and comment out the entry:\n```\nblacklist spi-bcm2708\n```\nby changing it to:\n```\n#blacklist spi-bcm2708\n```\nthen reboot your pi and type `ls /dev`.\nIf `spidev0.0` is in the list you're fine and you can repeat the test.","maintainers":[{"name":"fjw","email":"fjw@garx.de"}],"time":{"modified":"2022-06-26T20:05:34.327Z","created":"2013-08-14T15:39:49.591Z","0.0.1":"2013-08-14T15:39:52.333Z"},"author":{"name":"Frédéric Worm"},"repository":{"type":"git","url":"https://github.com/fjw/node-simplespi.git"},"users":{"tdamdouni":true}}