You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
List the steps to reproduce the problem below (if possible attach a sketch or
copy the sketch code in too): LIST REPRO STEPS BELOW
The following code appears to hang in Adafruit_SSD1306.begin rather than returns False if the screen is not present, or at least not powered. This is inconvenient, can't it be fixed with e.g. a timeout?
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
// The pins for I2C are defined by the Wire-library.
// On an arduino UNO: A4(SDA), A5(SCL)
// On an arduino MEGA 2560: 20(SDA), 21(SCL)
// On an arduino LEONARDO: 2(SDA), 3(SCL), ...
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for half a second
digitalWrite(LED_BUILTIN, LOW);
Serial.begin(9600);
while (!Serial) {
static long int time_out_time = millis() + 1000;
if ( millis() > time_out_time) break;
}; // wait for Serial set up to complete
Serial.println("\nFirst OLED SSD1306 Screen Test V0.1 Starting");
Serial.println("\nSetting up display");
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for half a second
digitalWrite(LED_BUILTIN, LOW);
// SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
Serial.println("Screen Set up failed");
for(;;); // Don't proceed, loop forever
}
Serial.println("SCreen Set up succeeded");
display.clearDisplay();
display.display();
Serial.println("Display Cleared");
display.setTextColor(SSD1306_WHITE);
display.setTextSize(2);
display.setCursor(0, 0);
Serial.println("About to Write");
int characters = display.write('X');
Serial.print("Wrote ");
Serial.println(characters);
display.display();
delay(1000);
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
}
// the loop function runs over and over again forever
void loop() {
}
The text was updated successfully, but these errors were encountered:
Arduino board: Nano Every
Arduino IDE version 2.3.4
List the steps to reproduce the problem below (if possible attach a sketch or
copy the sketch code in too): LIST REPRO STEPS BELOW
The following code appears to hang in Adafruit_SSD1306.begin rather than returns False if the screen is not present, or at least not powered. This is inconvenient, can't it be fixed with e.g. a timeout?
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
// The pins for I2C are defined by the Wire-library.
// On an arduino UNO: A4(SDA), A5(SCL)
// On an arduino MEGA 2560: 20(SDA), 21(SCL)
// On an arduino LEONARDO: 2(SDA), 3(SCL), ...
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for half a second
digitalWrite(LED_BUILTIN, LOW);
Serial.begin(9600);
while (!Serial) {
static long int time_out_time = millis() + 1000;
if ( millis() > time_out_time) break;
}; // wait for Serial set up to complete
Serial.println("\nFirst OLED SSD1306 Screen Test V0.1 Starting");
Serial.println("\nSetting up display");
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for half a second
digitalWrite(LED_BUILTIN, LOW);
// SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
Serial.println("Screen Set up failed");
for(;;); // Don't proceed, loop forever
}
Serial.println("SCreen Set up succeeded");
display.clearDisplay();
display.display();
Serial.println("Display Cleared");
display.setTextColor(SSD1306_WHITE);
display.setTextSize(2);
display.setCursor(0, 0);
Serial.println("About to Write");
int characters = display.write('X');
Serial.print("Wrote ");
Serial.println(characters);
display.display();
delay(1000);
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
}
// the loop function runs over and over again forever
void loop() {
}
The text was updated successfully, but these errors were encountered: