OLED Display With Arduino

Hi,

I'm trying to use a oled display and I just get a lot of white dots on the display. Here is the code any help is great!

Thank you,
Jaden

Code:
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <max6675.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
int thermoDO = 7;
int thermoCS = 5;
int thermoCLK = 6;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int val;
int encoder0PinA = 3;
int encoder0PinB = 4;
int encoder0Pos = 0;
int encoder0PinALast = LOW;
int n = LOW;

void setup() {
pinMode (9, OUTPUT);
pinMode (10, OUTPUT);
pinMode (encoder0PinA, INPUT);
pinMode (encoder0PinB, INPUT);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
delay(500);
}

void loop() {
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0, 0);
display.print("F = ");
display.println(thermocouple.readFahrenheit());
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0, 1);
display.print("F = ");
display.println(encoder0Pos);
n = digitalRead(encoder0PinA);
if ((encoder0PinALast == LOW) && (n == HIGH)) {
if (digitalRead(encoder0PinB) == LOW) {
encoder0Pos--;
} else {
encoder0Pos++;
if (thermocouple.readFahrenheit() > encoder0Pos) {
digitalWrite(10, LOW);// set pin 10 LOW
} else {
digitalWrite(10, HIGH);// set pin 10 HIGH
if (thermocouple.readFahrenheit() > encoder0Pos) {
digitalWrite(9, HIGH);
delay(5000);
digitalWrite(9, LOW);
} else {
digitalWrite(9, LOW);
}
delay(1000);
}
}}
}

This is an exact re-post of your Jul 14 post. Expecting different answers?

Hi Jaden,

I suspect your problem comes from here:

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

Your picture looks like an OLED device running Adafruit's 1306 library without hooking up the reset connection.

Try a different oled library, or get a 128x32 device that has a reset connector. Your reset appears to be attached to the encoder pin, is that right?

DKWatson:
This is an exact re-post of your Jul 14 post. Expecting different answers?

actually the earlier post was about a double bracket, and in this post the OP has solved the syntax error.
The OP now has a hardware problem. This is the wrong forum for that, but it's a different problem.

@blueelectronics:

  • Read the rules! You've been informed so if you want to engage here, just do what they say.
  • PM a mod and ask for this thread to be moved to General Hardware or Displays sub-forum.
  • Reply to the nice people who helped you earlier thread, and at least post a link to this thread.