带树莓派的可编址LED灯条

我一直在研究这一点,并没有发现任何结论。

我想用我的树莓派,可能与node.js(npm gpio)或python使用可寻址的LED。 我不太了解电路,但是我有一种感觉,树莓派没有数字写入能力。

该条有4个input(5V,SDI,CKI,GND)我正在使用这个: http ://www.amazon.com/gp/product/B008F05N54/ref=oh_details_o01_s00_i00?ie=UTF8&psc =1

这是我的一个单一的LED工作,但不是为了带:

var gpio = require("gpio"); var gpio22, gpio4, intervalTimer; // Flashing lights if LED connected to GPIO22 gpio22 = gpio.export(22, { ready: function() { inervalTimer = setInterval(function() { gpio22.set(); setTimeout(function() { gpio22.reset(); }, 500); }, 1000); } }); // Lets assume a different LED is hooked up to pin 4, the following code // will make that LED blink inversely with LED from pin 22 gpio4 = gpio.export(4, { ready: function() { // bind to gpio22's change event gpio22.on("change", function(val) { gpio4.set(1 - val); // set gpio4 to the opposite value }); } }); // reset the headers and unexport after 10 seconds setTimeout(function() { clearInterval(intervalTimer); // stops the voltage cycling gpio22.removeAllListeners('change'); // unbinds change event gpio22.reset(); // sets header to low gpio22.unexport(); // unexport the header gpio4.reset(); gpio4.unexport(function() { // unexport takes a callback which gets fired as soon as unexporting is done process.exit(); // exits your node program }); }, 10000) 

我想要做的就是使用我的可寻址LED灯带:

有谁知道我是否可以通过数字写入来处理可寻址LED? 我接近这个错误?

谢谢!! 我已经沉迷于此。

看看这个教程。 虽然我不完全理解这些条的工作方式,但是我已经设法使用这个代码以我的Pi的随机方式工作,但是我的条并不是由同一个制造商生产的。 我发现使用我的Arduino编程地带要容易得多。 Make杂志上还有一些关于使用Adafruit的LED灯条和面板的很好的教程。

https://learn.adafruit.com/light-painting-with-raspberry-pi/overview

干杯

史蒂夫

Interesting Posts