我一直在研究這一段時間,還沒有發現任何結論。樹莓派的可編址LED燈帶
我想用我的Raspberry pi的可尋址LED,可能帶有node.js(npm gpio)或python。我對電路知之甚少,但我有一種感覺,樹莓派沒有數字寫入能力。
鋼帶有4個輸入(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。 –
這看起來像使用與[this]相同的芯片組(http://www.adafruit.com/products/738)。也許你可以嘗試看看[這個庫](https://github.com/RussTheAerialist/node-spi)。 – Sean