// Set the location of several LEDs arranged in a strip.
// Angle is in radians, measured clockwise from +X.
// (x,y) is the center of the strip.
void ledStrip(int index, int count, float x, float y, float spacing, float angle, boolean reversed)
{
float s = sin(angle);
float c = cos(angle);
for (int i = 0; i < count; i++) {
led(reversed ? (index + count - 1 - i) : (index + i),
(int)(x + (i - (count-1)/2.0) * spacing * c + 0.5),
(int)(y + (i - (count-1)/2.0) * spacing * s + 0.5));
}
{
size(600, 600);
// Load a sample image
im = loadImage("flames.jpeg");
// Connect to the local instance of fcserver
opc = new OPC(this, "InMiCoTA", 7890);
float spaceAll = width/100;
for (int i = 0; i < 120; i++)
opc.ledStrip( 0, 22, (width/2)-((spaceAll*21)/2), (height/2)-(spaceAll*9), spaceAll, 0, true); //Bottom Led Addresses, Right
opc.ledStrip(22, 17, (width/2)-(spaceAll*21), (height/2), spaceAll, 3*PI/2, true); //Right Led Addresses
opc.ledStrip(39, 43, (width/2), (height/2)+(spaceAll*9), spaceAll, PI, true); //Top Led Addresses
opc.ledStrip(82, 17, (width/2)+(spaceAll*21), (height/2), spaceAll, (PI)/2, true); //Left Led Addresses
opc.ledStrip(99, 21, (width/2)+((spaceAll*22)/2), (height/2)-(spaceAll*9), spaceAll, 0, true); //Bottom Led Addresses, Left
}
Great I finally got it thanks to ur help @M-I-Kessler and @focalintent > here is the code that works: // Map one 54-LED strip to the center of the window
for (int i = 0; i < 8; i++)
opc.ledStrip(0, 54, width/2, height/4 + 15, width / 54.0, 0, false);
opc.ledStrip(64, 54, width/2, height/4 + 25, width / 54.0, 0, false);
opc.ledStrip(128, 54, width/2, height/4 + 35, width / 54.0, 0, false);
opc.ledStrip(192, 54, width/2, height/4 + 45, width / 54.0, 0, false);
opc.ledStrip(256, 54, width/2, height/4 + 55, width / 54.0, 0, false);
opc.ledStrip(320, 54, width/2, height/4 + 65, width / 54.0, 0, false);
opc.ledStrip(384, 54, width/2, height/4 + 75, width / 54.0, 0, false);
opc.ledStrip(448, 54, width/2, height/4 + 85, width / 54.0, 0, false);
}