Why is there a Wire.h file in that particular directory? The avr core 1.8.7 does not contain that file under cores, it is in libraries.
Why would I try to help? Bye.
All my files are there (52).
Under libraries there is more. 5 directories including “Wire”. That’s where my other Wire.h is.
Wire.h should be in avr/1.8.7/libraries/Wire/src, installed as part of the avr board package.
Would YOU compress a 51 byte file?
I think you hit it David. The wire.h in 1.8.7\cores\arduino is from Sparkfun.
I substituted the “real” wire.h for that from Sparkfun and the simple sketch compiles !!
Thanks for your observations Dave.
And thanks to everyone who took the time to help. Much appreciated.
How did that get there?
Sparkfun has their own library.
But there is no reason for the Sparkfun library to be saved inside the avr boards package. Normally a custom library goes into the libraries folder inside the Arduino folder where sketches are saved.
Doesn't explain how it got there. Besides Sparkfun would never name a library file wire.h
Tell Sparkfun.
BTW there are 50 files in the directory.
This should be the contents of the directory in question. This is linux, but the board package is the same on Windows, just a different location.
user@FIZWQW1:~/.arduino15/packages/arduino/hardware/avr/1.8.7/cores/arduino$ ls
abi.cpp HardwareSerial2.cpp IPAddress.h Printable.h Udp.h wiring_analog.c WMath.cpp
Arduino.h HardwareSerial3.cpp main.cpp Print.cpp USBAPI.h wiring.c WString.cpp
binary.h HardwareSerial.cpp new Print.h USBCore.cpp wiring_digital.c WString.h
CDC.cpp HardwareSerial.h new.cpp Server.h USBCore.h wiring_private.h
Client.h HardwareSerial_private.h new.h Stream.cpp USBDesc.h wiring_pulse.c
HardwareSerial0.cpp hooks.c PluggableUSB.cpp Stream.h WCharacter.h wiring_pulse.S
HardwareSerial1.cpp IPAddress.cpp PluggableUSB.h Tone.cpp WInterrupts.c wiring_shift.c
Well I certainly didn’t write it.
/****************************************************************************
The MIT License (MIT)
Copyright (c) 2024 SparkFun Electronics
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions: The
above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED
"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Distributed as-is; no warranty is given.
*****************************************************************************/
#include <Wire.h>
#include <SparkFun_Alphanumeric_Display.h>
//Click here to get the library: http://librarymanager/All#Alphanumeric_Display by SparkFun
HT16K33 display;
void setup() {
Serial.begin(115200);
Serial.println("Qwiic Alphanumeric examples");
Wire.begin(); //Join I2C bus
//check if displays will acknowledge
// if (display.begin(0x70) == false)
// if (display.begin(0x70, 0x71) == false)
// if (display.begin(0x70, 0x71, 0x72) == false)
if (display.begin(0x70, 0x71, 0x72, 0x73) == false)
{
Serial.println("Device did not acknowledge! Freezing.");
while(1);
}
Serial.println("Displays acknowledged.");
display.setBrightness(1);
// display.setBlinkRate(2);
// display.print("hell");
// display.print("hello st");
// display.print("hello stinky");
display.print("hello stinky poo");
}
void loop()
{
}
That is not a library.
It is a program that uses the standard Arduino Wire library.
(Wire with a capital W)
Thanks.
Yes I have that with a few SF files too.
When I replaced the SF wire.h with the standard Arduino wire.h, I am able to compile the empty sketch, but then my SF sketch won’t compile. Looks like I need both.
Some how you really messed things up. Your sketch only uses the standard Arduino Wire library and no other wire or Wire library.
Not sure how to instruct you on how to fix it.
Did you install the correct SparkFun library? In the Arduino IDE's library manager it is named "SparkFun Qwiic Alphanumeric Display Arduino Library"
With the “normal” wire.h replacing the one from SF, I believe I’m ok.
Can you help with this syntax error?
expected initializer before '.' token
#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
HT16K33 displays[4];
void setup() {
Wire.begin();
Serial.begin(9600);
// Initialize each display
for (int i = 0; i < 4; i++) {
HT16K33 displays[i].setI2CAddress(displayAddresses[i]); <-- ERROR
if (!displays[i].begin()) {
Serial.print("Display ");
Serial.print(i);
Serial.println(" not detected!");
} else {
displays[i].clear();
displays[i].print("----");
}
}
}