Why is my OLED not turning on

`Hi I've been trying to use an transparent OLED screen for my project and the code won't make it turn on. I don't actually see any lights on this OLED screen:
Transparent OLED screen

This is my code using the Adafruit_GFX and Adafruit_SSD1306 libraries:

//PLEASE PUT THE COLONS AFTER EVERY LINE IN SETUP AND LOOP IF NOT YOU JUST WASTED A LOT OF TIME

//Library for Arduino code
#include <Arduino.h>
//Library for Arduino SPI transparent OLED 
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
//Library for Arduino Nano 33 BLE Sense REV2's Temperature and Humidity Sensor 
#include <Arduino_HS300x.h>



//Defining the Pins and actual Module for the SPI OLED
#define ScreenWidth 128
#define ScreenHeight 64
#define OLED_DIN 3
#define OLED_CLK 2
#define OLED_DC  4
#define OLED_CS  5
#define OLED_RST 6

//Button Pin
#define buttonPin 9

//Cofigure and calibrate the Arduino Transparent OLED
Adafruit_SSD1306 display(ScreenWidth, ScreenHeight, OLED_DC, OLED_CS, OLED_RST);

void setup() {
  // put your setup code here, to run once:
  HS300x.begin();
  display.begin();

  //define the pinmode for the button
  pinMode(buttonPin, INPUT);
}

void loop() {
  // put your main code here, to run repeatedly
  //Define the two integers of the HS300x module
  float temperature = HS300x.readTemperature();
  float humidity = HS300x.readHumidity();

  // Read the value of the input. It can either be 1 or 0
  int buttonValue = digitalRead(buttonPin);
 
  // If button is pushed then turn on and print the temperature and humidity on the OLED
  //if (buttonValue == HIGH) {
  display.setCursor(0,0); 
  display.setTextSize(2);   
  display.setTextColor(WHITE);
  display.print("Hello world");
  //} 

}

Does someone know how to fix this?

What are you running the code in. How is it connected to the display. How is it powered. Posting an annotated schematic would help a lot. Links to technical information on each of the hardware parts will also help.

Hello @gilhultz the digital pins are as listed but the power connection is 3.3 V GND is GND of course and I'm using the ARduino IdE 2.1.1 Windows 10

If you are using software SPI you must use a different constructor. Like the one below.

// Declaration for SSD1306 display connected using software SPI (default case):
#define OLED_MOSI   9
#define OLED_CLK   10
#define OLED_DC    11
#define OLED_CS    12
#define OLED_RESET 13
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT,  OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);

The constructor in the posted code is a constructor for hardware SPI where the MOSI and SCK pins are known. The pins depend on the processor that is in use (Arduino board).

Youtube/upir made a video of the transparent OLED which might help...

Here's the link to the YouTube video I watched:

Just check the programming section

so should I change the library?

Answer post #2. Many good questions.

I powered it through USB, I don'thave a schematic software sadly, I connected it through jumper wires not on the breadboard and that's all I've got..

No, you do not change the library. Just use the proper constructor with the pin numbers that you want. Look at the examples that come with the library. They show the difference between a constructor for hardware and software SPI. I posted an example of the constructor for software SPI. Just change the pins.

Try this code with the constructor for softwate SPI. Not tested.

//PLEASE PUT THE COLONS AFTER EVERY LINE IN SETUP AND LOOP IF NOT YOU JUST WASTED A LOT OF TIME

//Library for Arduino code
#include <Arduino.h>
//Library for Arduino SPI transparent OLED
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
//Library for Arduino Nano 33 BLE Sense REV2's Temperature and Humidity Sensor
#include <Arduino_HS300x.h>



//Defining the Pins and actual Module for the SPI OLED
#define ScreenWidth 128
#define ScreenHeight 64
#define OLED_DIN 3
#define OLED_CLK 2
#define OLED_DC  4
#define OLED_CS  5
#define OLED_RST 6

//Button Pin
#define buttonPin 9

//Cofigure and calibrate the Arduino Transparent OLED
//Adafruit_SSD1306 display(ScreenWidth, ScreenHeight, OLED_DC, OLED_CS, OLED_RST);
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT,  OLED_DIN, OLED_CLK, OLED_DC, OLED_RST, OLED_CS);

void setup()
{
   // put your setup code here, to run once:
   HS300x.begin();
   display.begin();

   //define the pinmode for the button
   pinMode(buttonPin, INPUT);
}

void loop()
{
   // put your main code here, to run repeatedly
   //Define the two integers of the HS300x module
   float temperature = HS300x.readTemperature();
   float humidity = HS300x.readHumidity();

   // Read the value of the input. It can either be 1 or 0
   int buttonValue = digitalRead(buttonPin);

   // If button is pushed then turn on and print the temperature and humidity on the OLED
   //if (buttonValue == HIGH) {
   display.setCursor(0, 0);
   display.setTextSize(2);
   display.setTextColor(WHITE);
   display.print("Hello world");
   //}
}

what piece of code did you change?

also can you check out the youtube video above to see if the coding matches?

I commented out your constructor for hardware SPI and put in the constructor for software SPI.

Does the display show anything now?

I'm checking

it's taking a second to load

Nope

should I change the power supply to five volts with an arduino uno board

Hand drawn, photographed and posted is fine. Include all pin names/numbers, components, their part numbers and/or values and power supplies.

Photos of the setup and wiring are often helpful.

I'll get you a picture