CODE "error status 1"

I have the following code and when I try to verify it I get an “error status 1” Can you assist?

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

// 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

// 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      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
}

Hi @David51846,

Can you attach the following include files:

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

As I am new to all this can you tell me where to add it in code?
Start? End?

That code is already in there?

It might be worth starting from the top, following Adafruit’s example here https://learn.adafruit.com/32x16-32x32-rgb-led-matrix/overview

Let me know what part is not working for you in that tutorial!

I tried the process of retrying everything a couple of times?
I think I am noty understanding the downloading of the libraries?

Your shared code is very different to the Adafruit tutorial. The Adafruit tutorial also has steps for downloading the additional files needed https://learn.adafruit.com/32x16-32x32-rgb-led-matrix/test-example-code

If you are new to Arduino then it would be best to just follow their guide, verbatim. Their guide is bulletproof, I’ve just followed it step by step and was able to compile without any errors.

Which file do you download, it is so confusing?

You click on the libraries and it only shows a list of files, which on is downloaded?

Where are you coming undone on this part of the tutorial

Yes,

U click the links and it takes you to a list of files, then i cannot see a zip file?

Here’s how you download the zip package on Github

Thanks for that. I’ll try later but that’s what I didn’t do!

1 Like

Hi,

Getting there but now getting the following at the end?:

Arduino: 1.8.5 (Mac OS X), Board: "Arduino/Genuino Uno"

/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware -tools /private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/tools-builder -tools /private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/libraries -libraries /Users/dc/Documents/Arduino/libraries -fqbn=arduino:avr:uno -ide-version=10805 -build-path /var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543 -warnings=default -build-cache /var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_cache_348330 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Users/dc/Documents/Arduino/WHEEL5/WHEEL5.ino
/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware -tools /private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/tools-builder -tools /private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/libraries -libraries /Users/dc/Documents/Arduino/libraries -fqbn=arduino:avr:uno -ide-version=10805 -build-path /var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543 -warnings=default -build-cache /var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_cache_348330 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Users/dc/Documents/Arduino/WHEEL5/WHEEL5.ino
Using board 'uno' from platform in folder: /private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/arduino/avr
Using core 'arduino' from platform in folder: /private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/arduino/avr
Detecting libraries used...
"/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/sketch/WHEEL5.ino.cpp" -o "/dev/null"
"/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "-I/Users/dc/Documents/Arduino/libraries/Adafruit_GFX" "/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/sketch/WHEEL5.ino.cpp" -o "/dev/null"
"/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "-I/Users/dc/Documents/Arduino/libraries/Adafruit_GFX" "-I/Users/dc/Documents/Arduino/libraries/RGBLEDMatrix" "/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/sketch/WHEEL5.ino.cpp" -o "/dev/null"
Using cached library dependencies for file: /Users/dc/Documents/Arduino/libraries/Adafruit_GFX/Adafruit_GFX.cpp
Using cached library dependencies for file: /Users/dc/Documents/Arduino/libraries/Adafruit_GFX/Adafruit_SPITFT.cpp
Using cached library dependencies for file: /Users/dc/Documents/Arduino/libraries/Adafruit_GFX/glcdfont.c
Using cached library dependencies for file: /Users/dc/Documents/Arduino/libraries/RGBLEDMatrix/RGBmatrixPanel.cpp
Using cached library dependencies for file: /private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src/SPI.cpp
Generating function prototypes...
"/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "-I/Users/dc/Documents/Arduino/libraries/Adafruit_GFX" "-I/Users/dc/Documents/Arduino/libraries/RGBLEDMatrix" "-I/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src" "/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/sketch/WHEEL5.ino.cpp" -o "/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/preproc/ctags_target_for_gcc_minus_e.cpp"
"/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/preproc/ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os  -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "-I/Users/dc/Documents/Arduino/libraries/Adafruit_GFX" "-I/Users/dc/Documents/Arduino/libraries/RGBLEDMatrix" "-I/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src" "/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/sketch/WHEEL5.ino.cpp" -o "/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/sketch/WHEEL5.ino.cpp.o"
Compiling libraries...
Compiling library "Adafruit_GFX"
Using previously compiled file: /var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/libraries/Adafruit_GFX/glcdfont.c.o
Using previously compiled file: /var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/libraries/Adafruit_GFX/Adafruit_GFX.cpp.o
Using previously compiled file: /var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/libraries/Adafruit_GFX/Adafruit_SPITFT.cpp.o
Compiling library "RGBLEDMatrix"
Using previously compiled file: /var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/libraries/RGBLEDMatrix/RGBmatrixPanel.cpp.o
Compiling library "SPI"
Using previously compiled file: /var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/libraries/SPI/SPI.cpp.o
Compiling core...
Using precompiled core
Linking everything together...
"/private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc"  -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p  -o "/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/WHEEL5.ino.elf" "/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/sketch/WHEEL5.ino.cpp.o" "/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/libraries/Adafruit_GFX/glcdfont.c.o" "/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/libraries/Adafruit_GFX/Adafruit_GFX.cpp.o" "/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/libraries/Adafruit_GFX/Adafruit_SPITFT.cpp.o" "/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/libraries/RGBLEDMatrix/RGBmatrixPanel.cpp.o" "/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/libraries/SPI/SPI.cpp.o" "/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543/../arduino_cache_348330/core/core_arduino_avr_uno_9288f17158bb14a86b050974c6323be3.a" "-L/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/arduino_build_344543" -lm
/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T//cc6cPdqj.ltrans0.ltrans.o: In function `setup':
/Users/dc/Documents/Arduino/WHEEL5/WHEEL5.ino:31: undefined reference to `setup::RGBmatrixPanel::RGBmatrixPanel(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, bool, unsigned char)'
/Users/dc/Documents/Arduino/WHEEL5/WHEEL5.ino:39: undefined reference to `setup::RGBmatrixPanel::begin()'
/Users/dc/Documents/Arduino/WHEEL5/WHEEL5.ino:41: undefined reference to `setup::Adafruit_GFX::width() const'
/Users/dc/Documents/Arduino/WHEEL5/WHEEL5.ino:43: undefined reference to `setup::Adafruit_GFX::height() const'
/Users/dc/Documents/Arduino/WHEEL5/WHEEL5.ino:59: undefined reference to `setup::RGBmatrixPanel::ColorHSV(long, unsigned char, unsigned char, bool)'
/Users/dc/Documents/Arduino/WHEEL5/WHEEL5.ino:63: undefined reference to `setup::RGBmatrixPanel::drawPixel(int, int, unsigned int)'
collect2: error: ld returned 1 exit status
Using library Adafruit_GFX at version 1.2.2 in folder: /Users/dc/Documents/Arduino/libraries/Adafruit_GFX 
Using library RGBLEDMatrix at version 1.0.2 in folder: /Users/dc/Documents/Arduino/libraries/RGBLEDMatrix 
Using library SPI at version 1.0 in folder: /private/var/folders/8v/kmh9zdm92y93ljhdvy7sh0q40000gn/T/AppTranslocation/BE908C8B-65F8-4938-B28A-85C10BA9C9D8/d/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI 
exit status 1
Error compiling for board Arduino/Genuino Uno.

void setup() { LINE33: ERROR ??

void setup() {
  // put your setup code here, to run once:
// colorwheel demo for Adafruit RGBmatrixPanel library.
// Renders a nice circle of hues on our 32x32 RGB LED matrix:
// http://www.adafruit.com/products/607

// 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

// 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 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
}
}

void loop() {
  // put your main code here, to run repeatedly:

}

Given the nature of your journey, it might be best to start with a ground-level overview of Arduino, such as our Arduino Workshop. It’ll walk you through the whole ecosystem and hopefully leave you with a solid grip on how to tackle issues such as this, along with many others.

1 Like

Hi David,

That error that you pictured in your last post is indicative that the object usage from the RGB matrix library isn’t compiling correctly. @Graham’s advice with the Arduino Workshop is going to be the quickest way for you to get stuck into Arduino. I’d highly recommend getting your feet wet with a few projects using the included libraries first.

Best of luck with your Arduino journey, and be sure to let us know if you get stuck.

1 Like