controlling an Adafruit RGB strip with Max Msp
Hey everybody im currently doing a university project and I have to find a way how to control an RGB LED strip from Max Msp via Arduino.
The strip is purchased from adafruit, check this link:
http://www.adafruit.com/products/306
I need to control every LED on the strip individually with Max msp. How can I send an R G B value to change the colour and an ON/OFF message to turn them on and off individually.
Here´s an arduino library made for the LED strip. I have been looking at the strandtest code to figure out how it works, but Im quite stuck at the moment.
I hope someone have some experience with the adafruit LED strip :)
user gavspav and I are working with those - gavin's gotten his working, but with the teensy - code should be somewhat adaptable:
https://cycling74.com/forums/jit-iter-for-driving-rgb-leds
It depends what you want to do and how many lights you have.
You need to establish serial communication between Max and Arduino.
If you have 256 leds or less you could send 4 bytes - 1 for determining which light and then 3 rgb values.
Then in the Arduino code read the serial data and set the led's accordingly.
If you want to change alot of led's quickly you need to send bigger packets of data.
Or write led patterns in the arduino code and trigger them from Max.
In the strandtest example it is strip.setPixelColor(led,color) which (theoretically) sets each pixel and strip.show which actually updates it.
If you are updating alot of leds set the pixels first and then use strip.show when you've finished as strip.show takes a long time (relatively).
Good Luck!