0

32x32 Power Question
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

32x32 Power Question

by Phizy on Mon Apr 16, 2018 4:48 pm

Hey, everyone, I am brand new to Arduino and I am trying to work with a 32x32 matrix and an Arduino Mega. I have the panel wired to the Arduino correctly (I think) and I am getting a 1 green line and 2 yellows I am assuming this is because I do not have the panel powered? Is there a guide or tutorial on making a portable power supply for the matrix? I have attached a picture of what my matrix looks like when I run the color wheel demo code. I also have a doubleheader matrix with a Molex power plug. Any help would be greatly appreciated!

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_GFX.h>   // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library

// If your matrix has the DOUBLE HEADER input, use:
#define CLK 11  // MUST be on PORTB! (Use pin 11 on Mega)
#define LAT 9
#define OE  10
#define A   A3
#define B   A2
#define C   A1
#define D   A0
RGBmatrixPanel matrix(A, B, C, D, CLK, LAT, OE, false);

void setup() {
  int      x, y, hue;
  float    dx, dy, d;
  uint8_t  sat, val;
  uint16_t c;

  matrix.begin();

  for(y=0; y < matrix.width(); y++) {
    dy = 15.5 - (float)y;
    for(x=0; x < matrix.height(); x++) {
      dx = 15.5 - (float)x;
      d  = dx * dx + dy * dy;
      if(d <= (16.5 * 16.5)) { // Inside the circle(ish)?
        hue = (int)((atan2(-dy, dx) + PI) * 1536.0 / (PI * 2.0));
        d = sqrt(d);
        if(d > 15.5) {
          // Do a little pseudo anti-aliasing along perimeter
          sat = 255;
          val = (int)((1.0 - (d - 15.5)) * 255.0 + 0.5);
        } else
        {
          // White at center
          sat = (int)(d / 15.5 * 255.0 + 0.5);
          val = 255;
        }
        c = matrix.ColorHSV(hue, sat, val, true);
      } else {
        c = 0;
      }
      matrix.drawPixel(x, y, c);
    }
  }
}

void loop() {
  // do nothing
}
Attachments
IMG_0271 (1).JPG
IMG_0271 (1).JPG (98.31 KiB) Viewed 93 times

Phizy
 
Posts: 2
Joined: Mon Apr 16, 2018 4:43 pm

Please be positive and constructive with your questions and comments.