Datasheet
Write a sketch
At this point we've assembled a NeoMatrix and Fadecandy Controller, we tried some
examples, and we put some materials in front of the LEDs to see how they look. Now let's
try making a Processing sketch from scratch.
In this example, we'll make a simple particle system that creates expanding wavefronts in
response to mouse gestures.
Here's how it looks:
(Direct link to the video (http://adafru.it/cWl))
So that's shiny. Let's write some code!
To get the OPC.pde library (http://adafru.it/cW9) easily, we'll start by opening the template
example included in Fadecandy's processing examples folder. Then we can save that
example with a new name. The template starts you out with just enough code to connect to
fcserver:
// This is an empty Processing sketch with support for Fadecandy.
OPC opc;
void setup()
{
size(600, 300);
opc = new OPC(this, "127.0.0.1", 7890);
// Set up your LED mapping here
}
void draw()
{
background(0);
// Draw each frame here
}
First, let's set this up to talk to an 8x8 pixel NeoMatrix. Change the setup() to look like this:
void setup()
{
size(500, 500, P3D);
© Adafruit Industries https://learn.adafruit.com/led-art-with-fadecandy Page 48 of 60










