Closed KaboChueng closed 8 years ago
Hello! Another big problem. Sometimes, program would get stuck and couldn't stop. Is something wrong with signal transmission? We really need your help!
function go (i,end){
if(i<end){
if(i !== 0){
var j = (i-1);
ledStrip.setLed(j,1,0,0,0);
}
ledStrip.setLed(i,1,255,255,255);
ledStrip.pushState();
setTimeout(go,500,++i,end);
}
else{
ledStrip.setAllLeds(1,0,0,0);
return ;
}
}
var lib = require('jsupm_apa102');
var ledStrip = new lib.APA102(30,0,true);
when I run this for some times ,program would get stuck, and I have to reboot my edison .Why?
Hi, I think I have one of these LED strips and I will take a look to see what can be done. Meanwhile, there's a known issue with SPI on Edison where you have to turn off power management for most of the SPI sensor modules to work correctly. You can do so with:
echo on > /sys/devices/pci0000\:00/0000\:00\:07.1/power/control
Hello. This problem has been solved after I reload my edison system.It works currectly now ! Thank you very much ! And can you solve my another quetion about mpu9150 ?
@KaboChueng, setLeds() has two overloads:
setLeds(uint16_t startIdx, uint16_t endIdx, uint8_t brightness, uint8_t r, uint8_t g, uint8_t b)
which should be straightforward to use and
setLeds(uint16_t startIdx, uint16_t endIdx, uint8_t* colors)
If you want to call the second form in Node.js or Pyhon you'll need to use the uint8Array()
wrapper for proper type mapping. Check our pn532 examples on how to use that. From Java you should be able to use byte[] as your array.
Let me know if you're still having issues otherwise I will close this.
Hello! I don't know how to use the function - setLeds(). I try to pass an array as the third parameter,but it's wrong. Can you make an example?