I am a new user and am struggling to compile my 1st program. I get this wire.h error: “#include nested too deeply”, which Github says means a name clash or a circular include. So on their suggestion, I wrote a new empty sketch with wire.h and I get the same error. If I replace the SF wire.h with the standard Arduino wire.h, I can compile the empty sketch, but then my SF sketch won’t compile. Should I combine the two wire.h files? Thanks.
A bit more information please :
which sketch ?
which board do you use ?
Forget wire.h I believe that is resolved.
My board is RedboardPlus
Sketch:
#include <Wire.h>
#include <SparkFun_Alphanumeric_Display.h>
// I2C addresses for each Qwiic Alphanumeric Display
const byte displayAddresses[4] = {0x70, 0x71, 0x72, 0x73};
// Create display objects for each address
Alphanumeric_Display displays[4];
void setup() {
Wire.begin();
Serial.begin(9600);
// Initialize each display
for (int i = 0; i < 4; i++) {
displays[i].setI2CAddress(displayAddresses[i]);
if (!displays[i].begin()) {
Serial.print(“Display “);
Serial.print(i);
Serial.println(” not detected!”);
} else {
displays[i].clear();
displays[i].print(“----”);
}
}
}
void loop() {
int analogVals[4];
// Read analog inputs A0, A1, A2, A3
for (int i = 0; i < 4; i++) {
analogVals[i] = analogRead(A0 + i);
}
// Send readings to displays
for (int i = 0; i < 4; i++) {
// Convert analog value (0-1023) to string
char buffer[5];
snprintf(buffer, sizeof(buffer), “%4d”, analogVals[i]);
displays[i].print(buffer);
}
delay(200); // Update rate
}
Errors:
C:\temp.arduinoIDE-unsaved2026027-23260-2udce7.gygdx\sketch_jan27a\sketch_jan27a.ino:9:1: error: ‘Alphanumeric_Display’ does not name a type
}
^
C:\temp.arduinoIDE-unsaved2026027-23260-2udce7.gygdx\sketch_jan27a\sketch_jan27a.ino: In function ‘void setup()’:
C:\temp.arduinoIDE-unsaved2026027-23260-2udce7.gygdx\sketch_jan27a\sketch_jan27a.ino:17:5: error: ‘displays’ was not declared in this scope
C:\temp.arduinoIDE-unsaved2026027-23260-2udce7.gygdx\sketch_jan27a\sketch_jan27a.ino:17:5: note: suggested alternative: ‘delay’
C:\temp.arduinoIDE-unsaved2026027-23260-2udce7.gygdx\sketch_jan27a\sketch_jan27a.ino: In function ‘void loop()’:
C:\temp.arduinoIDE-unsaved2026027-23260-2udce7.gygdx\sketch_jan27a\sketch_jan27a.ino:42:5: error: ‘displays’ was not declared in this scope
C:\temp.arduinoIDE-unsaved2026027-23260-2udce7.gygdx\sketch_jan27a\sketch_jan27a.ino:42:5: note: suggested alternative: ‘delay’
C:\temp.arduinoIDE-unsaved2026027-23260-2udce7.gygdx\sketch_jan27a\sketch_jan27a.ino: At global scope:
C:\temp.arduinoIDE-unsaved2026027-23260-2udce7.gygdx\sketch_jan27a\sketch_jan27a.ino:47:1: error: expected declaration before ‘}’ token
exit status 1
Compilation error: ‘Alphanumeric_Display’ does not name a type
check the examples that are provided with library. They indicate ‘HT16K33’ instead ‘Alphanumeric_Display’.