beyondscreen / node-rpi-ws281x-native

native bindings to drive WS2811 (or WS2812) LED-Controllers on a Raspberry Pi
MIT License
224 stars 101 forks source link

Refactor to use nan #5

Closed achingbrain closed 9 years ago

achingbrain commented 9 years ago

Refactors the C++ parts to use rvagg/nan for compatibility with io.js and node 0.12. Also adds .gitignore file to ignore node_modules, build artefacts and other noise.

Cross reference: iojs/io.js#456

usefulthink commented 9 years ago

You are awesome! Thanks a lot for this, using nan was on my list for a while now and didn't have the time to figure out what needs to be changed to make it work. Will test it right away and merge if there are no problems.

usefulthink commented 9 years ago

works as intended, do you happen to know if this works with the arm-builds of iojs? I am curious if there need to be changes to the TypedArray-access in the C++-part for newer V8-versions.

usefulthink commented 9 years ago

just published a new version to npm. Thanks for your help!

achingbrain commented 9 years ago

Using the provided arm6 build of io.js 1.4.2 I've got it working with a diode between a couple of ws2812s as per the Adafruit wiring guide but I'm having problems using a SparkFun logic level converter for more LEDs, although I'm probably using the wrong thing. I've got a 74HCT125N on order to mirror your setup.

achingbrain commented 9 years ago

One thing I have noticed is that if you new up an Uint32Array with length 16 or under, it balks in the C++ code claiming it's not a Uint32Array. This might be an internal node/io.js "optimisation" though.

usefulthink commented 9 years ago

never tried the diode-variant or anything else as i got it working from the start using the 74HCT125N. Do you have access to an oscilloscope to have a look at the signal coming out of the sparkfun llc?

achingbrain commented 9 years ago

Sadly no, just a multimeter.

achingbrain commented 9 years ago

Meh, actually I think I just had a loose wire or two, the llc seems to work fine.