Library doesn’t show up

Perplexed and astonished. That is my reaction to what’s going on. I’ve worked 4 days on this problem but can’t seem to solve it. Here is my setup:
CPU=Win11. BOARD=ESP32 DEVKIT V.1 Arduino IDE 2.11(latest) OLED= 2.42” or .96 COM13 USING =DOIT ESP32 DEVKIT V1
Here is what’s driving me crazy; I could open an example like ssd1306_128x64_12c.ino, it will compile and run just fine, OLED happily running and stars falling from the sky.
So far so good, HOWEVER many of my sketches that used to run OK will fail. I believe it has to do with the library.
As an example if I compile the standard blink program it works, but, if I add a simple #include like:
#include SSD1306_Wire.h OR #include SSD1306Wire.h OR #include ssd1306Wire.h, I quickly get an error message:

C:\Users\greg\Documents\Arduino\OLED_Display_Millis\OLED_Display_Millis.ino:3:10: fatal error: SSD1306_WIRE.h: No such file or directory
 #include "SSD1306Wire.h"        // legacy: #include "SSD1306.h"
          ^~~~~~~~~~~~~~~~
compilation terminated.
Alternatives for SSD1306Wire.h: []
ResolveLibrary(SSD1306Wire.h)
  -> candidates: []

Using library Wire at version 2.0.0 in folder: C:\Users\greg\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\Wire 
exit status 1

Compilation error: SSD1306_WIRE.h: No such file or directory 

I have SSD1306_WIRE in my library and it contains SSD1306_WIRE.h and SSD1306_WIRE.ccp.

I can’t add SSD1306_WIRE simply because it doesn’t show up when I type it in library manager.

I’m totally in a fog, can anyone raise the temperature above the due-point to lift my fog?

Many thanks!

I moved your topic to an appropriate forum category @gregfox151.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

Hi @gregfox151

Do you know where the example came from? If we were able to look at the library the example is associated with, the forum helpers might be able to provide more effective assistance.

What is the exact menu path in Arduino IDE you use to open the example (e.g., File > Examples > Foobar > ssd1306_128x64_12c).

If the filename is really SSD1306_WIRE.h, then the error is expected because you used a different filename in your #include directive (SSD1306Wire.h). The two filenames must match exactly.

The search in Library Manager returns results for matches in the library name and description. It does not search through a comprehensive list of files in the library. So you will only get a result when searching for a header filename if that filename happens to be in the content Library Manager searches against.

Here is the code"

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "SSD1306Wire.h"
#define OLED_RESET -1

Adafruit_SSD1306 display(OLED_RESET);

void setup()   {   
          
   pinMode(LED_BUILTIN, OUTPUT);
 //Wire.begin(D4,D5); //I2C addr 0x3C SDA,SCL
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3D (for the 128x64)    // init done
delay(500);
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(62,0);

  display.println("OLED");
    display.setCursor(45,12);
  display.println("* TEST *");
 
      display.setCursor(0,22);
      display.println("123456789*1234567890*");
  display.display();
    display.drawString(128, 54, String(millis()));
  
  }
  void loop() { 
   

   }

Here are the error messages, I could not add it all as it exceeded 12000 characters:

FQBN: esp32:esp32:esp32doit-devkit-v1
Using board 'esp32doit-devkit-v1' from platform in folder: C:\Users\greg\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11
Using core 'esp32' from platform in folder: C:\Users\greg\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11

cmd /c if exist "C:\\Users\\greg\\Documents\\Arduino\\OLED_Minumin_Needed\\partitions.csv" COPY /y "C:\\Users\\greg\\Documents\\Arduino\\OLED_Minumin_Needed\\partitions.csv" "C:\\Users\\greg\\AppData\\Local\\Temp\\arduino\\sketches\\5B9C4BD80BBF69428AEDFDD549E216A6\\partitions.csv"
cmd /c if not exist "C:\\Users\\greg\\AppData\\Local\\Temp\\arduino\\sketches\\5B9C4BD80BBF69428AEDFDD549E216A6\\partitions.csv" if exist "C:\\Users\\greg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.11\\variants\\doitESP32devkitV1\\partitions.csv" COPY "C:\\Users\\greg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.11\\variants\\doitESP32devkitV1\\partitions.csv" "C:\\Users\\greg\\AppData\\Local\\Temp\\arduino\\sketches\\5B9C4BD80BBF69428AEDFDD549E216A6\\partitions.csv"
cmd /c if not exist "C:\\Users\\greg\\AppData\\Local\\Temp\\arduino\\sketches\\5B9C4BD80BBF69428AEDFDD549E216A6\\partitions.csv" COPY "C:\\Users\\greg\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.11\\tools\\partitions\\default.csv" 
compilation terminated.

Using library Wire at version 2.0.0 in folder: C:\Users\greg\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\Wire 
Using library Adafruit GFX Library at version 1.11.7 in folder: C:\Users\greg\Documents\Arduino\libraries\Adafruit_GFX_Library 
Using library Adafruit BusIO at version 1.14.1 in folder: C:\Users\greg\Documents\Arduino\libraries\Adafruit_BusIO 
Using library SPI at version 2.0.0 in folder: C:\Users\greg\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\SPI 
Using library Adafruit SSD1306 at version 2.5.7 in folder: C:\Users\greg\Documents\Arduino\libraries\Adafruit_SSD1306 
exit status 1

Compilation error: SSD1306Wire.h: No such file or directory

Why did you add that line to the sketch? It is not present in the original "ssd1306_128x64_i2c" example from the "Adafruit SSD1306" library:

https://github.com/adafruit/Adafruit_SSD1306/blob/2.5.7/examples/ssd1306_128x64_i2c/ssd1306_128x64_i2c.ino

Why did you add this include to blink sketch?
Where from you get this filename? It is not a library name.

Hi, I added it to show that I can't seem to #include this library. I can run the library in a blank sketch and get the same error.

Where did you get this library name from?
There is no such library:

You can't add a random string as include directive, you can include only the library, that exists on your PC

Hi,
To be clear, on this new script, I still get the error SSD1306Wire.h: No such file or directory


#include <Wire.h>               // Only needed for Arduino 1.6.5 and earlier
#include "SSD1306Wire.h"        // legacy: #include "SSD1306.h"

// Initialize the OLED display using Arduino Wire:
SSD1306Wire display(0x3c, SDA, SCL);   // ADDRESS, SDA, SCL  -  SDA and SCL usually populate automatically based on your board's pins_arduino.h e.g. https://github.com/esp8266/Arduino/blob/master/variants/nodemcu/pins_arduino.h

void setup() {
  Serial.begin(115200);
  display.init();     // Initialising the UI will init the display too.
  display.flipScreenVertically();
  display.setFont(ArialMT_Plain_10);
}

void loop() {
  // clear the display
  display.clear();
  display.setFont(ArialMT_Plain_10);        //display.setTextAlignment(TEXT_ALIGN_CENTER);
  display.drawString(40, 0, "Milli Seconds");

  display.setFont(ArialMT_Plain_16);
  //display.setTextAlignment(TEXT_ALIGN_RIGHT);
  display.drawString(0, 10, String(millis()));                //one milli-second
  
    display.setFont(ArialMT_Plain_10);
    display.drawString(0, 25, "Seconds");
    display.setFont(ArialMT_Plain_10);
    display.drawString(50,25, String(millis()/1000));         //one second

      display.setFont(ArialMT_Plain_10);
      display.drawString(0, 35, "Minutes");
      //display.setTextAlignment(TEXT_ALIGN_RIGHT);
      display.drawString(52,35, String(millis()/60000));      //One minute
      

      display.setFont(ArialMT_Plain_10);
      display.drawString(0, 45, "Hours");
      //display.setTextAlignment(TEXT_ALIGN_RIGHT);
      display.drawString(52,45, String(millis()/3600000));    //One Hour

            display.setFont(ArialMT_Plain_10);
      display.drawString(0, 54, "Days");
      //display.setTextAlignment(TEXT_ALIGN_RIGHT);
      display.drawString(52,54, String(millis()/86400000));   //One Day
  
  
  display.display(); 

}
Error message:
C:\Users\greg\Desktop\ARDUINO Hol\Arduino8-9-2023\OLED_Display_Millis\OLED_Display_Millis.ino:3:10: fatal error: SSD1306Wire.h: No such file or directory
 #include "SSD1306Wire.h"        // legacy: #include "SSD1306.h"
          ^~~~~~~~~~~~~~~
compilation terminated.

Using library Wire at version 2.0.0 in folder: C:\Users\greg\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\Wire 
exit status 1

Compilation error: SSD1306Wire.h: No such file or directory

This script used to work!

This is my whole library:

Adafruit_BusIO
Adafruit_GFX
Adafruit_SSD1306
Adafruit_SSD1306_EMULATOR
SSD1306Wire.h

Exactly where on your PC is SSD1306Wire.h located ?

Because you don't have this library!

See the comment:

is the "SSD1306Wire.h" a just a typo ?
Is the correct library name "SSD1306.h"` ???

This is my whole library:

Adafruit_BusIO
Adafruit_GFX
Adafruit_SSD1306
Adafruit_SSD1306_EMULATOR
SSD1306Wire.h  <--- in my library (C:\Users\greg\Documents\Arduino\libraries)

It just doesn't see it.

Please show a screenshot of this folder

If the file really is in C:\Users\greg\Documents\Arduino\libraries then it is in the wrong place. It should be in a folder within C:\Users\greg\Documents\Arduino\libraries. The folder would normally have the same namea as the .h file and there is probably a .cpp file to go with it but that is not mandatory

Can you read this?

I can read it and the file is in the wrong place as I said previously

How did you install the library ?

I downloaded it from github?
Can you tell me where it belongs?

Then you copied it to an incorrect location

Create a folder in C:\Users\greg\Documents\Arduino\libraries named SSD1306Wire and move the file there, but I suspect that there is at least one more file, SSD1306Wire.cpp that needs to be in the same folder