LED Matrix 32 x 32 Analog pins not declared in scope

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
caitlindriver
 
Posts: 5
Joined: Sat May 02, 2015 4:16 pm

LED Matrix 32 x 32 Analog pins not declared in scope

Post by caitlindriver »

The code wont upload to the arduino mega and these error messages keep coming up:

colorwheel_progmem_32x32:33: error: 'A0' was not declared in this scope
colorwheel_progmem_32x32:33: error: 'A1' was not declared in this scope
colorwheel_progmem_32x32:33: error: 'A2' was not declared in this scope
colorwheel_progmem_32x32:33: error: 'A3' was not declared in this scope

Here is the test code that I downloaded from GitHub

Code: Select all

// colorwheel_progmem demo for Adafruit RGBmatrixPanel library.
// Renders a nice circle of hues on our 32x32 RGB LED matrix:
// http://www.adafruit.com/products/607

// This version uses precomputed image data stored in PROGMEM
// rather than calculating each pixel.  Nearly instantaneous!  Woo!

// Written by Limor Fried/Ladyada & Phil Burgess/PaintYourDragon
// for Adafruit Industries.
// BSD license, all text above must be included in any redistribution.

#include <Adafruit_GFX.h>   // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library
#include "image.h"

// If your 32x32 matrix has the SINGLE HEADER input,
// use this pinout:
#define CLK 8  // MUST be on PORTB! (Use pin 11 on Mega)
#define OE  9
#define LAT 10
#define A   A0
#define B   A1
#define C   A2
#define D   A3
// If your matrix has the DOUBLE HEADER input, use:
//#define CLK 8  // 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     i, len;
  uint8_t *ptr = matrix.backBuffer(); // Get address of matrix data

  // Copy image from PROGMEM to matrix buffer:
  memcpy_P(ptr, img, sizeof(img));

  // Start up matrix AFTER data is copied.  The RGBmatrixPanel
  // interrupt code ties up about 40% of the CPU time, so starting
  // it now allows the prior drawing code to run even faster!
  matrix.begin();
}

void loop() {
  // do nothing
}
I re-downloaded the libraries, restarted everything and haven't messed with anything else... If anyone can help, help!

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: LED Matrix 32 x 32 Analog pins not declared in scope

Post by Franklin97355 »

What are you compiling it for? I just downloaded and compiled for the Uno without errors with no changes to the code

User avatar
caitlindriver
 
Posts: 5
Joined: Sat May 02, 2015 4:16 pm

Re: LED Matrix 32 x 32 Analog pins not declared in scope

Post by caitlindriver »

I am compiling it on an Arduino Mega.

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: LED Matrix 32 x 32 Analog pins not declared in scope

Post by Franklin97355 »

Works for me on the mega also. I would recommend removing the libraries and downloading them new. I'm using IDE 1.6.3 to compile.

User avatar
caitlindriver
 
Posts: 5
Joined: Sat May 02, 2015 4:16 pm

Re: LED Matrix 32 x 32 Analog pins not declared in scope

Post by caitlindriver »

Worked like a charm! Thank you

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”