Hello,
nothing too complicated here, just strange. I just started a new code and as I tried to compile it (to see if all my variables were declared right) I got this error message:
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:32:0,
from sketch\NewAnalyser.ino.cpp:1:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/binary.h:31:12: error: expected unqualified-id before numeric constant
#define B1 1
^
C:\Users\Juliak\Documents\Arduino\ArduinoSketches\Matrix\analyser_8X8\NewAnalyser\NewAnalyser.ino:33:7: note: in expansion of macro 'B1'
byte B1 = Blue[0];
^
exit status 1
Error compiling.
With the following code:
const byte AudioIn = 6;
const byte Strobe = 5;
const byte Reset = 6;
const byte Clock = 11;
const byte Data = 12;
const byte Latch = 13;
byte value[7]; // Audio signal magnitude for each frequency
byte Red[8];
byte Green[8];
byte Blue[8];
byte R1 = Red[0];
byte R2 = Red[1];
byte R3 = Red[2];
byte R4 = Red[3];
byte R5 = Red[4];
byte R6 = Red[5];
byte R7 = Red[6];
byte R8 = Red[7];
byte G1 = Green[0];
byte G2 = Green[1];
byte G3 = Green[2];
byte G4 = Green[3];
byte G5 = Green[4];
byte G6 = Green[5];
byte G7 = Green[6];
byte G8 = Green[7];
byte B1 = Blue[0];
byte B2 = Blue[1];
byte B3 = Blue[2];
byte B4 = Blue[3];
byte B5 = Blue[4];
byte B6 = Blue[5];
byte B7 = Blue[6];
byte B8 = Blue[7];
void setup()
{
pinMode(AudioIn, INPUT);
pinMode(Strobe, OUTPUT);
pinMode(Reset, OUTPUT);
pinMode(Clock, OUTPUT);
pinMode(Data, OUTPUT);
pinMode(Latch, OUTPUT);
delay(2000);
//initialize audio chip
digitalWrite(Reset, LOW);
digitalWrite(Strobe, LOW);
delay(100);
digitalWrite(Reset, HIGH);
delay(1);
digitalWrite(Reset, LOW);
delay(1000); // MSGEQ7 ready for use
}
//////////////////////////////////////////////////////////
void loop()
{
}
However, if I change "B1" for a different name, like B9, or if I comment it out, it compiles...
byte B1 = Blue[0]; // this is the B1 I'm talking about
byte B2 = Blue[1];
byte B3 = Blue[2];
byte B4 = Blue[3];
Any ideas on why is it acting like this? I wouldn't deny the possibility of an error on my side, but I can not find where could my code be incorrect.
Thanks ![]()
Mike