Hallo zusammen,
ich wende mich mal wieder mit einem Problem an euch, für das ich aktuell keinen Beitrag finde.
Ich setzte das “neue” Nano R4 Board mit Renesas RA4M1 Microcontroller ein. Ich möchte mit diesem Board ein OLED-Display 128x64 betreiben. Leider zeigt das Display bisher nichts an.
OLED: 1,3 Zoll OLED Display I2C SSH1106 Chip 128 x 64 Pixel I2C Anzeigemodul
Ich habe das Display über VCC +5V, GND, SDA, SCL angeschlossen.
Probiert habe ich auch schon A4 (SDA) und A5 (SCL).
Ich habe bisher folgende Bibliotheken verwendet:
Adafruit_SSD1306.h und alternativ U8g2lib
Sketch mit Adafruit_SSD1306:
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <SPI.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 0x3D ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup() {
// Initialize serial communication and wait up to 2.5 seconds for a connection
Serial.begin(9600);
for (auto startNow = millis() + 2500; !Serial && millis() < startNow; delay(500));
display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS);
delay(500); // Break for 0,5 seconds
// Clear the buffer
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0, 0);
display.print("TEST OLED");
display.display();
}
void loop() {
}
Sketch mit U8g2lib:
#include <Arduino.h>
#include <Wire.h> // Wire Bibliothek einbinden
#include "U8g2lib.h"
// 0,96 Zoll SSD1306
//U8G2_SSD1306_128X64_NONAME_1_HW_I2C oled(U8G2_R0);
// 1,3 Zoll SH1106
U8G2_SH1106_128X64_NONAME_1_HW_I2C oled(U8G2_R0);
};
void setup() {
Serial.begin(9600);
while(!Serial){}
// Display starten
oled.begin();
// Kontrast Dispaly maximal 255
oled.setContrast(255);
oled.setFont(u8g2_font_t0_11_tf);
oled.clear();
oled.setCursor(0, 0);
oled.print("TEST OLED");
}
void loop() {
}
Hat jemand von euch eine Idee was ich falsch mache? Wenn ich es richtig verstehe sind beide Bibliotheken für den Nano R4 geeignet.
Grüße



