64x32 LED matrix

no... sorry I said this before and I didn't know I had a p5 but thank you.

#include <RGBmatrixPanel.h>

// Most of the signal pins are configurable, but the CLK pin has some
// special constraints.  On 8-bit AVR boards it must be on PORTB...
// Pin 11 works on the Arduino Mega.  On 32-bit SAMD boards it must be
// on the same PORT as the RGB data pins (D2-D7)...
// Pin 8 works on the Adafruit Metro M0 or Arduino Zero,
// Pin A4 works on the Adafruit Metro M4 (if using the Adafruit RGB
// Matrix Shield, cut trace between CLK pads and run a wire to A4).

#define CLK  8   // USE THIS ON ADAFRUIT METRO M0, etc.
//#define CLK A4 // USE THIS ON METRO M4 (not M0)
//#define CLK 11 // USE THIS ON ARDUINO MEGA
#define OE   9
#define LAT 10
#define A   A0
#define B   A1
#define C   A2

// Last parameter = 'true' enables double-buffering, for flicker-free,
// buttery smooth animation.  Note that NOTHING WILL SHOW ON THE DISPLAY
// until the first call to swapBuffers().  This is normal.
RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, true);

static const int8_t PROGMEM sinetab[256] = {
     0,   2,   5,   8,  11,  15,  18,  21,
    24,  27,  30,  33,  36,  39,  42,  45,
    48,  51,  54,  56,  59,  62,  65,  67,
    70,  72,  75,  77,  80,  82,  85,  87,
    89,  91,  93,  96,  98, 100, 101, 103,
   105, 107, 108, 110, 111, 113, 114, 116,
   117, 118, 119, 120, 121, 122, 123, 123,
   124, 125, 125, 126, 126, 126, 126, 126,
   127, 126, 126, 126, 126, 126, 125, 125,
   124, 123, 123, 122, 121, 120, 119, 118,
   117, 116, 114, 113, 111, 110, 108, 107,
   105, 103, 101, 100,  98,  96,  93,  91,
    89,  87,  85,  82,  80,  77,  75,  72,
    70,  67,  65,  62,  59,  56,  54,  51,
    48,  45,  42,  39,  36,  33,  30,  27,
    24,  21,  18,  15,  11,   8,   5,   2,
     0,  -3,  -6,  -9, -12, -16, -19, -22,
   -25, -28, -31, -34, -37, -40, -43, -46,
   -49, -52, -55, -57, -60, -63, -66, -68,
   -71, -73, -76, -78, -81, -83, -86, -88,
   -90, -92, -94, -97, -99,-101,-102,-104,
  -106,-108,-109,-111,-112,-114,-115,-117,
  -118,-119,-120,-121,-122,-123,-124,-124,
  -125,-126,-126,-127,-127,-127,-127,-127,
  -128,-127,-127,-127,-127,-127,-126,-126,
  -125,-124,-124,-123,-122,-121,-120,-119,
  -118,-117,-115,-114,-112,-111,-109,-108,
  -106,-104,-102,-101, -99, -97, -94, -92,
   -90, -88, -86, -83, -81, -78, -76, -73,
   -71, -68, -66, -63, -60, -57, -55, -52,
   -49, -46, -43, -40, -37, -34, -31, -28,
   -25, -22, -19, -16, -12,  -9,  -6,  -3
};

void setup() {
  matrix.begin();
}

const float radius1 =65.2, radius2 =92.0, radius3 =163.2, radius4 =176.8,
            centerx1=64.4, centerx2=46.4, centerx3= 93.6, centerx4= 16.4,
            centery1=34.8, centery2=26.0, centery3= 56.0, centery4=-11.6;
float       angle1  = 0.0, angle2  = 0.0, angle3  =  0.0, angle4  =  0.0;
long        hueShift= 0;

#define FPS 15         // Maximum frames-per-second
uint32_t prevTime = 0; // For frame-to-frame interval timing

void loop() {
  int           x1, x2, x3, x4, y1, y2, y3, y4, sx1, sx2, sx3, sx4;
  unsigned char x, y;
  long          value;

  sx1 = (int)(cos(angle1) * radius1 + centerx1);
  sx2 = (int)(cos(angle2) * radius2 + centerx2);
  sx3 = (int)(cos(angle3) * radius3 + centerx3);
  sx4 = (int)(cos(angle4) * radius4 + centerx4);
  y1  = (int)(sin(angle1) * radius1 + centery1);
  y2  = (int)(sin(angle2) * radius2 + centery2);
  y3  = (int)(sin(angle3) * radius3 + centery3);
  y4  = (int)(sin(angle4) * radius4 + centery4);

  for(y=0; y<matrix.height(); y++) {
    x1 = sx1; x2 = sx2; x3 = sx3; x4 = sx4;
    for(x=0; x<matrix.width(); x++) {
      value = hueShift
        + (int8_t)pgm_read_byte(sinetab + (uint8_t)((x1 * x1 + y1 * y1) >> 4))
        + (int8_t)pgm_read_byte(sinetab + (uint8_t)((x2 * x2 + y2 * y2) >> 4))
        + (int8_t)pgm_read_byte(sinetab + (uint8_t)((x3 * x3 + y3 * y3) >> 5))
        + (int8_t)pgm_read_byte(sinetab + (uint8_t)((x4 * x4 + y4 * y4) >> 5));
      matrix.drawPixel(x, y, matrix.ColorHSV(value * 3, 255, 255, true));
      x1--; x2--; x3--; x4--;
    }
    y1--; y2--; y3--; y4--;
  }

  angle1   += 0.03;
  angle2   -= 0.07;
  angle3   += 0.13;
  angle4   -= 0.15;
  hueShift += 2;

  // To ensure that animation speed is similar on AVR & SAMD boards,
  // limit frame rate to FPS value (might go slower, but never faster).
  // This is preferable to delay() because the AVR is already plenty slow.
  uint32_t t;
  while(((t = millis()) - prevTime) < (1000 / FPS));
  prevTime = t;

  matrix.swapBuffers(false);
}

that is the code. well the original code. cause i had to change some things cause I have a 64x32 not a 16x32

heres the gray cable:

really of stupid of me to put it on my bed. but my computer is by my bed so its easiest.

Is this what you bought?

If so please note that it says:-

There's a lot of LEDs! You may need up to 4A per panel.

How are you powering this?

no I bought it at a local store called vetco. And my power is 5v and 10 amps. too many amps? not sure... but whenever I'm programming it i just use my computers usb to power it and it can turn on all the Leds fine but its just glitchy.

thank you!

It is not fine. You need to supply the right voltage and enough amps. 64x32x20mA = 40A. Is the power consumption written on the back panel?

You can't have too many amps in a power supply. The current rating of a power supply is only the maximum current it will supply. It is not what it will supply. That depends on what load you connect it to. The only down side for having way too much current available is it becomes very unforgiving in the case of a short circuit and could vaporise connections.

By the way you need to connect the ground of this power supply to the ground of the Arduino as well.

These sort of panels don't use LEDs with a 20mA current consumption. They are also multiplexed and that reduces avrage current consumption anyway.

That is a classic case of insufficient power supply decoupling. See my tutorial about this:-
De-coupling tutorial

1 Like

there's no power consumption on the back of the panel...

hello. thank you for the detailed response! but I'm confused when you say i need to connect the ground of my power supply to the Arduino...

here's what my connection from my power supply to the board looks like:

and this is what my arduino looks like plugged in(just showing that it is powered.)

thank you everyone for the help. and sorry that I'm new to this stuff...

You need to do this to obtain a stable reference, otherwise the voltage is called floating, and this will give you problems like you see.

That is irrelevant, the ground on the power supply must be connected to the ground on the Arduino. So take the negative output from the other end of your power supply and connect it to one of the ground pins of the Arduino.

Isn't the flat grey cable somewhere supposed to connect arduino ground to module ground?

@xfpd have you ever looked into a (5Vx40A=) 200W halogen light?
Try 200W led light. Just a second (to prevent permanent eye damage).
10A shouldbe more than sufficient..

Hello. Yes I will try that tomorrow but my power right now is coming from my pc. it’s not well… so thank you very much. I’ll tell you if it helps or not

Tungsten. Wore OD5 goggles. Used it as a heat source.

@build_1971 - I did not know the panel had different LED properties and configured to reduce consumption (@Grumpy_Mike).

You need to select an example for 64x32 panel, because your matrix can't work with the code for 32x16 one. In particular, you need to connect "D" pin on the matrix to address a 64x32 panel

Even more - you forgot to multiply by three, because each pixel consists of three diodes - R, G & B.
But the good news is that this panel, judging by the inscriptions on PCB, uses multiplexing by16, so the real consuming is 16 times smaller.

hello. so right now, I'm working on is connecting my gnd from my power supply to the Arduino... does anyone have an image or video how to do that? I don't wanna mess anything up so I wanna just make sure.

You don't need to connect it directly, since the flat cable between Arduino and the panel has a several GND wires in it.

What should I power the Arduino with?

An external power supply.
You said you were using just your PC to provide the power but you did not say how. Do you mean you connected wires to the PC's power supply and brought hem out?

The Adafruit link suggested 5V at 4A capacity power supply.

No. I plugged a usb to a USBc that connected my pc to the arduino. So I could code it. But I know that’s not enough power. So I tried to also plug in my transformer but when I touched the board it was a little hot so I immediately turned unplugged the transformer.

Also when you say take the negative output from the other end of your power supply… I’m not quite sure on that… sorry but it’s a little confusing.

Also here’s a picture of my transformer:

Again thank you and I’m really sorry I’m not great at this

No that is a picture of your power supply, a transformer is just two or more coils wound on the same core. It needs a lot of other stuff to turn a transformer into a power supply.

If you have an external power supply it is most likely that it will have two outputs marked + and -. The one marked - should be connected to the ground of the Arduino.

Do not confuse (but I know you will) the ground, as in protective ground that is actually connected through your water pipe or stake in the soil, with the common ground of a circuit.

See this post:-