I am trying to create a graphic equalizer using a MSGQE7 chip (Already built WORKING circuit) and a 5x7 Neopixel matrix (working). I am able to read the values coming in from the IC, but I cannot for the life of me get the Neopixel, neopixel matrix, or GFX libraries from Adafruit to play nice together. I have cobbled together (poorly) examples of other similar code in an attempt to get this working. I continue to receive this :
Graphic_Eq__EQ_WORKS_CODING_GFX.ino: In function 'void loop()':
Graphic_Eq__EQ_WORKS_CODING_GFX:72: error: expected initializer before '.' token
Graphic_Eq__EQ_WORKS_CODING_GFX:73: error: expected initializer before '.' token
Graphic_Eq__EQ_WORKS_CODING_GFX:74: error: expected initializer before '.' token
Graphic_Eq__EQ_WORKS_CODING_GFX:75: error: expected initializer before '.' token
Graphic_Eq__EQ_WORKS_CODING_GFX:76: error: expected initializer before '.' token
Graphic_Eq__EQ_WORKS_CODING_GFX:77: error: expected initializer before '.' token
Graphic_Eq__EQ_WORKS_CODING_GFX:78: error: expected initializer before '.' token
Graphic_Eq__EQ_WORKS_CODING_GFX:79: error: expected initializer before '.' token
I have tried to figure this out but cannot seem to get it going. Am I even close? Any guidance would be greatly appreciated!
the steaming pile that is my code is below:
#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_NeoPixel.h>
#ifndef PSTR
#define PSTR // Make Arduino Due happy
#endif
//define colors
#define black 0,0,0
#define blue (0,0,255)
#define cyan 0,255,255
#define gray 128,128,128
#define green 0,128,0
#define lime 0,255,0
#define magenta 255,0,255
#define maroon 128,0,0
#define navy 0,0,128
#define olive 128,128,0
#define purple 128,0,128
#define red 255,0,0
#define silver 192,192,192
#define teal 0,128,128
#define white 255,255,255
#define yellow 255,255,0
#define oranje 255,165,0
//Color Definitions
#define PIN 6
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(5, 7, PIN,
NEO_MATRIX_BOTTOM + NEO_MATRIX_LEFT +
NEO_MATRIX_COLUMNS + NEO_MATRIX_PROGRESSIVE,
NEO_GRB + NEO_KHZ800);
int analogPin = 0; // read from multiplexer using analog input 0
int strobePin = 2; // strobe is attached to digital pin 2
int resetPin = 3; // reset is attached to digital pin 3
int spectrumValue[7]; // to hold a2d values
int specChoke = 0;
const uint16_t colors[] = {
matrix.Color(255, 0, 0), matrix.Color(0, 255, 0), matrix.Color(0, 0, 255) };
void setup()
{ matrix.begin();
Serial.begin(9600);
pinMode(analogPin, INPUT);
pinMode(strobePin, OUTPUT);
pinMode(resetPin, OUTPUT);
analogReference(DEFAULT);
int x = matrix.width();
digitalWrite(resetPin, LOW);
digitalWrite(strobePin, HIGH);
}
void loop()
{
digitalWrite(resetPin, HIGH);
digitalWrite(resetPin, LOW);
for (int i = 0; i < 7; i++)
{matrix.fillScreen(0);
digitalWrite(strobePin, LOW);
delayMicroseconds(30); // to allow the output to settle
spectrumValue[i] = analogRead(analogPin);
specChoke = map(i, 0, 1023, 0, 7);
{
{
if (spectrumValue[i]>=895) { void matrix.drawFastVLine(uint16_t x0, uint16_t y0, uint16_t 1, uint16_t 1); } else
if (spectrumValue[i]>=767) { void matrix.drawFastVLine(uint16_t x0, uint16_t y0, uint16_t 1, uint16_t 1); } else
if (spectrumValue[i]>=639) { void matrix.drawFastVLine(uint16_t x0, uint16_t y0, uint16_t 1, uint16_t 1); } else
if (spectrumValue[i]>=511) { void matrix.drawFastVLine(uint16_t x0, uint16_t y0, uint16_t 1, uint16_t 1); } else
if (spectrumValue[i]>=383) { void matrix.drawFastVLine(uint16_t x0, uint16_t y0, uint16_t 1, uint16_t 1); } else
if (spectrumValue[i]>=255) { void matrix.drawFastVLine(uint16_t x0, uint16_t y0, uint16_t 1, uint16_t 1); } else
if (spectrumValue[i]>=127) { void matrix.drawFastVLine(uint16_t x0, uint16_t y0, uint16_t 1, uint16_t 1); } else
if (spectrumValue[i]>=0) { void matrix.fillScreen(0); }
}
Serial.println(spectrumValue[i]);
}
matrix.show();
}
}