Display OLED SSD1327

Buen dia , estoy utilizando un Display OLED SSD127 128x128. I2C.
Utilizo la Librería u8g2
ref. Universal 8bit Graphics Library (GitHub - olikraus/u8g2: U8glib library for monochrome displays, version 2)

y cargue el ejemplo que trae dentro de ella. Weather.
sobre Arduino UNO.
Pero como se ve en la imagen NO logro ver toda la imagen.

img1

Dejo el código utilizado si alguno tiene alguna pista de porque no se ve completo.
Gracias

/*

  Weather.ino
  
  Demonstrates:
    - Weather icons from open-iconic set.
    - Text scrolling.
    - Partial screen update
    
  This example requires display height >= 64.

  Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)

  Copyright (c) 2016, olikraus@gmail.com
  All rights reserved.

  Redistribution and use in source and binary forms, with or without modification, 
  are permitted provided that the following conditions are met:

  * Redistributions of source code must retain the above copyright notice, this list 
    of conditions and the following disclaimer.
    
  * Redistributions in binary form must reproduce the above copyright notice, this 
    list of conditions and the following disclaimer in the documentation and/or other 
    materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 
  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 
  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  

*/

#include <Arduino.h>
#include <U8g2lib.h>

#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif


/*
  U8g2lib Example Overview:
    Frame Buffer Examples: clearBuffer/sendBuffer. Fast, but may not work with all Arduino boards because of RAM consumption
    Page Buffer Examples: firstPage/nextPage. Less RAM usage, should work with all Arduino boards.
    U8x8 Text Only Example: No RAM usage, direct communication with display controller. No graphics, 8x8 Text only.
    
  This is a page buffer example.    
*/

// Please UNCOMMENT one of the contructor lines below
// U8g2 Contructor List (Picture Loop Page Buffer)
// The complete list is available here: https://github.com/olikraus/u8g2/wiki/u8g2setupcpp
// Please update the pin numbers according to your setup. Use U8X8_PIN_NONE if the reset pin is not connected

//U8G2_SSD1327_SEEED_96X96_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE);	// Seeedstudio Grove OLED 96x96

//U8G2_SSD1327_SEEED_96X96_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);	// Seeedstudio Grove OLED 96x96

//U8G2_SSD1327_EA_W128128_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ 5, /* data=*/ 4, /* reset=*/ U8X8_PIN_NONE);

// Funciona parcial.
U8G2_SSD1327_EA_W128128_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE);


//U8G2_SSD1327_EA_W128128_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); /* Uno: A4=SDA, A5=SCL, add "u8g2.setBusClock(400000);" into setup() for speedup if possible */

//U8G2_SSD1327_MIDAS_128X128_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); /* Uno: A4=SDA, A5=SCL, add "u8g2.setBusClock(400000);" into setup() for speedup if possible */

// End of constructor list




#define SUN	0
#define SUN_CLOUD  1
#define CLOUD 2
#define RAIN 3
#define THUNDER 4

void drawWeatherSymbol(u8g2_uint_t x, u8g2_uint_t y, uint8_t symbol)
{
  // fonts used:
  // u8g2_font_open_iconic_embedded_6x_t
  //   u8g2_font_open_iconic_weather_6x_t
  // encoding values, see: https://github.com/olikraus/u8g2/wiki/fntgrpiconic
  
  switch(symbol)
  {
    case SUN:
      u8g2.setFont(u8g2_font_open_iconic_weather_6x_t);
      u8g2.drawGlyph(x, y, 69);	
      break;
    case SUN_CLOUD:
      u8g2.setFont(u8g2_font_open_iconic_weather_6x_t);
      u8g2.drawGlyph(x, y, 65);	
      break;
    case CLOUD:
      u8g2.setFont(u8g2_font_open_iconic_weather_6x_t);
      u8g2.drawGlyph(x, y, 64);	
      break;
    case RAIN:
      u8g2.setFont(u8g2_font_open_iconic_weather_6x_t);
      u8g2.drawGlyph(x, y, 67);	
      break;
    case THUNDER:
      u8g2.setFont(u8g2_font_open_iconic_embedded_6x_t);
      u8g2.drawGlyph(x, y, 67);
      break;      
  }
}

void drawWeather(uint8_t symbol, int degree)
{
  drawWeatherSymbol(0, 48, symbol);
  u8g2.setFont(u8g2_font_logisoso32_tf);
  u8g2.setCursor(48+3, 42);
  u8g2.print(degree);
  u8g2.print("°C");		// requires enableUTF8Print()
}

/*
  Draw a string with specified pixel offset. 
  The offset can be negative.
  Limitation: The monochrome font with 8 pixel per glyph
*/
void drawScrollString(int16_t offset, const char *s)
{
  static char buf[36];	// 36 should for screen with up to 256 pixel width 
  size_t len;
  size_t char_offset = 0;
  u8g2_uint_t dx = 0;
  size_t visible = 0;
  

  u8g2.setDrawColor(0);		// clear the scrolling area
  u8g2.drawBox(0, 49, u8g2.getDisplayWidth()-1, u8g2.getDisplayHeight()-1);
  u8g2.setDrawColor(1);		// set the color for the text
    
  
  len = strlen(s);
  if ( offset < 0 )
  {
    char_offset = (-offset)/8;
    dx = offset + char_offset*8;
    if ( char_offset >= u8g2.getDisplayWidth()/8 )
      return;
    visible = u8g2.getDisplayWidth()/8-char_offset+1;
    strncpy(buf, s, visible);
    buf[visible] = '\0';
    u8g2.setFont(u8g2_font_8x13_mf);
    u8g2.drawStr(char_offset*8-dx, 62, buf);
  }
  else
  {
    char_offset = offset / 8;
    if ( char_offset >= len )
      return;	// nothing visible
    dx = offset - char_offset*8;
    visible = len - char_offset;
    if ( visible > u8g2.getDisplayWidth()/8+1 )
      visible = u8g2.getDisplayWidth()/8+1;
    strncpy(buf, s+char_offset, visible);
    buf[visible] = '\0';
    u8g2.setFont(u8g2_font_8x13_mf);
    u8g2.drawStr(-dx, 62, buf);
  }
  
}

void draw(const char *s, uint8_t symbol, int degree)
{
  int16_t offset = -(int16_t)u8g2.getDisplayWidth();
  int16_t len = strlen(s);
  
  u8g2.clearBuffer();					// clear the internal memory
  drawWeather(symbol, degree);		// draw the icon and degree only once
  for(;;)							// then do the scrolling
  {
  
    drawScrollString(offset, s);  			// no clearBuffer required, screen will be partially cleared here
    u8g2.sendBuffer();				// transfer internal memory to the display

    delay(20);
    offset+=2;
    if ( offset > len*8+1 )
      break;
  }
}


void setup(void) {

  u8g2.begin();  
  u8g2.enableUTF8Print();
  u8g2.setBusClock(400000);
}

void loop(void) {

  draw("What a beautiful day!", SUN, 27);
  draw("The sun's come out!", SUN_CLOUD, 19);
  draw("It's raining cats and dogs.", RAIN, 8);
  draw("That sounds like thunder.", THUNDER, 12);
  draw("It's stopped raining", CLOUD, 15);
  
  
  
}

Su publicacion se MUEVE a su ubicacion actual ya que es mas adecuada.

@miguelsag estás usando el constructor equivocado, es justamente uno de los 2 que están debajo del que usas porque el Uno tiene puerto I2C hardware. La sigla HW se refiere a hardware (como el puerto I2C que tiene el Uno) y SW a software, o sea puerto I2C emulado (innecesario en el Uno).

Saludos

Estimado @anon90500195 gracias por su repuesta y perdone la hora.
Realice las pruebas de acuerdo a su sugerencia y el resultado es negativo, no se muestra nada en la pantalla... cambie por los dos items HW alternativamente .
No se que mas puedo realizar.
Gracias

De la unica forma que parcialmente muestra algo es de los constructores que tienen la sigla SW (Soft.) con HW nada...

bien probe con es constructor
U8G2_SSD1327_SEEED_96X96_1_SW_I2C u8g2(U8G2_R0, /* clock=/ SCL, / data=/ SDA, / reset=*/ U8X8_PIN_NONE);

y se ve segun la foto...

Vamos a invocar al especialista...
@TFTLCDCyg, teléfono! :smile:

Saludos

Bueno muchas gracias, seguro la magia ocurrirá....

Tendrás un link a la pantalla que tienes para saber las especificaciones, posiblemente se deba configurar el tamaño correcto por eso no se muestra correctamente el sketch

Hola buen día, gracias por su respuesta.
le envió el link del fabricante:

img3

Google.
Oled SSD1327 128x128 pixels, Arduino por I2C

Hola buen día, gracias por el aporte ya probé eso pero evidentemente el problema es del chipset que es SSD1327 tiene alguna característica que no alcanzo a saber. Y por eso no funciona correctamente, ya vi ese video y probé y no realiza eso.
Gracias por el aporte.
Saludos

Pues en principio no hay más, la pantalla funciona entre 3V y 5V, los ejemplos son correctos y presuponemos que tienes bien conectados el SCL al pin A5 y el SDA al pin A4

Aunque según el vídeo que te puse tendrías que ponerlo así (no dispongo de esta pantalla para comprobarlo):

U8G2_SSD1327_EA_W128128_1_SW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);

sin los SCL, SDA cómo parámetros.

Hola , probé la modificación y da error de compilación para ese Constructor. Adjunto el error...
Arduino:1.8.16 (Windows 10), Tarjeta:"Arduino Uno"

Weather1:77:73: error: no matching function for call to 'U8G2_SSD1327_EA_W128128_1_SW_I2C::U8G2_SSD1327_EA_W128128_1_SW_I2C(const u8g2_cb_t*, int)'

In file included from C:\Users\Acer\Desktop\Año 2019 2020\Arduino\SSD1327 I2C\Weather1\Weather1.ino:44:0:

C:\Users\Acer\Documents\Arduino\libraries\U8g2\src/U8g2lib.h:7893:11: note: candidate: U8G2_SSD1327_EA_W128128_1_SW_I2C::U8G2_SSD1327_EA_W128128_1_SW_I2C(const u8g2_cb_t*, uint8_t, uint8_t, uint8_t)

public: U8G2_SSD1327_EA_W128128_1_SW_I2C(const u8g2_cb_t *rotation, uint8_t clock, uint8_t data, uint8_t reset = U8X8_PIN_NONE) : U8G2() {

       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

¿Las librerías U8g2 y Adafruit SSD1327 están actualizadas? Yo me guio por el tutorial porque el controlador que aparece en el ejemplo de la librería para UNO aparece en la línea 121 y no tiene eso.

En el vídeo sale la Adafruit SSD1327 v1.0 y U8g2 v2.31.2 ¿Concuerda con tus librerías?

He probado a seguir el tutorial, he instalado las librerías correspondientes he descomentado la línea 121 para UNO y compila perfectamente... ( y no lleva los parámetros que tiene tu línea)

Edito: Sigue el tutorial, carga el ejemplo de GraphicTest y a partir de ahí mira ver si funciona...

Hola nuevamente. Probé según el ejemplo del tutorial y en diferentes variantes de los constructores , la única que funciono fue descomentando la linea 113.

U8G2_SSD1327_SEEED_96X96_1_SW_I2C u8g2(U8G2_R0, /* clock=/ SCL, / data=/ SDA, / reset=*/ U8X8_PIN_NONE);

en los otros ninguna mostro nada...
Gracias por su atención.

Lo que no cuadra es que te diese error una línea que no da problema al descomentar y compilar (por que ya lo probé), luego alguna modificación no es correcta.

No veo mucho sentido probar cada línea de constructor cuando la documentación para UNO te dice que el constructor es ese y ya. Supongo que es probar por probar pero...

No se me ocurre más. ya he visto la documentación y si los pines A4 y A5 están donde corresponden el código de los ejemplos con la línea adecuada descomentada debería hacer funcionar esa OLED. Lo mismo otro ve algo que a mí se me escapa.

El constructor es para una pantalla de 96x96 pixeles, tu pantalla es de 128x128 pixeles.

La librería Ug8 no ha sido actualizada en mas de 7 años, tocaría buscar todas las líneas para 96x96 y adaptarlas a 128x128.

Creo que esta libreria iría mucho mejor:

SSD1327 and SSD1322 OLED display library for Arduino+Linux

Otra librería que deberías considerar es esta:

Puede manejar esa variante de pantalla. La he probado con una pantalla oled SD1331-spi de 128x64 px y una SD1306-spi de 128x64 en una placa blackpill F411CE, usé el núcleo alterno para STM32 de danieleff.