Proyecto con pantalla Oled. Dudas, consultas y, espero que respuestas tambien

Buenas.

Espero que esto sea un paso a pasode como conseguir hacer lo que quiero, posteare dudas y posteare las soluciones que consiga.

Proyecto de un semi-novato en Arduino.

Idea: Tengo un pulsador, cada vez que pulso éste, la pantalla OLED debe mostrar una imagen diferente hasta llegar a una concreta donde se quede estacionado hasta resetear

Por ahora he conseguido conectar la pantalla OLED al arduino poniendo
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); para que me lo reconozca.

Mi primer problema viene al intentar meter una imagen.

Me he bajado el LCDAssistant y he sacado el código tal que así

const unsigned char des1 [] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x07, 0xFF, 0xFF, 0xFE, 0x00, 0x0F, 0xFF, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xC0, 0x0F, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xE0, 0x1F, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x3F, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x01, 0xFE, 0x00, 0x00, 0x07, 0xF8, 0x3F, 0x1F, 0x07, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x7F, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x7E, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0xFC, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF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x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

Pero no consigo que me lo muestre en la pantalla...y mira que he mirado tutoriales... En teoria deberia salir con display.drawBitmap(30,16, logo16_glcd_bmp, 16,16,1); pero no hay forma

Hola,
Y que tal si para empezar cambias logo16_glcd_bmp por des1 que es como has llamado a tu array. Copiar y pegar es muy malo

Bueno tienes razon, es que el post lo he escrito a posteriori y tenia el código un poco cambiado. Pero poniendo el mismo nombre tampoco me funciona :frowning:

Voy a poner el codigo completo actual

/*********************************************************************

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2



#define LOGO16_GLCD_HEIGHT 16 
#define LOGO16_GLCD_WIDTH  16 
static const unsigned char PROGMEM logo16_glcd_bmp[] =
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x07, 0xFF, 0xFF, 0xFE, 0x00, 0x0F, 0xFF, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xC0, 0x0F, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xE0, 0x1F, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x3F, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x01, 0xFE, 0x00, 0x00, 0x07, 0xF8, 0x3F, 0x1F, 0x07, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x7F, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x7E, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0xFC, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x07, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x07, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x07, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x07, 0xE0, 0x20,
0x01, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x20,
0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x20,
0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x20,
0x01, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x1F, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x20,
0x01, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x1F, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0x07, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x1F, 0x00, 0x7F, 0xFF, 0xFF, 0xFE, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

#define SSD1306_LCDHEIGHT 64

#if (SSD1306_LCDHEIGHT != 64)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif

void setup()   {                
  Serial.begin(9600);

  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  // init done
  
  // Show image buffer on the display hardware.

  display.display();
  delay(2000);

  // Clear the buffer.
  display.clearDisplay();

  // draw a single pixel
  display.drawPixel(100, 10, WHITE);

  display.display();
  delay(2000);
  display.clearDisplay();

  display.drawPixel(10, 10, WHITE);

  delay(2000);
  display.clearDisplay();

  


}


void loop() {

   // draw a single pixel
  display.drawPixel(100, 10, WHITE);
  display.display();
  delay(2000);
  display.clearDisplay();

  display.drawBitmap(30,16, logo16_glcd_bmp, 16,16,1);
  display.display();
   delay(2000);
  display.clearDisplay();

  display.drawPixel(10, 10, WHITE);
  display.display();
  delay(2000);
  display.clearDisplay();
  
}

La idea es que una vez entre en el loop, ponga el pixel blanco y la imagen cada 2 segundos todo el rato, sin embargo, cuando va a mostrar la imagen, lo meustra todo negro. Es raro porque al inicializar, si la carga bien.

Una vez tenga esto resuelto, empezaré a avanzar con el resto, pero como l ode la pantalla es nuevo para mi, quiero resolverlo nada mas empezar

Parece ser que el arry tiene que estar declarada con la palabra clave PROGMEM.

rodripelto:
Parece ser que el arry tiene que estar declarada con la palabra clave PROGMEM.

No lo entiendo donde tengo que hacerlo.

Aqui ya está así :

static const unsigned char PROGMEM logo16_glcd_bmp[] = {

Lo siento, no no había visto, estaría dormido yo juraría que cuando has respondido no habias puesto nada de código.

Es raro porque al inicializar, si la carga bien.

¿ a que te refieres?

Porque usas static en un global? Ver PROGMEM
Eso es para rutinas y funciones, donde se desea conservar el estado anterior definido localmente.

usa solo esto

const unsigned char PROGMEM logo16_glcd_bmp[] = {

surbyte:
Porque usas static en un global? Ver PROGMEM
Eso es para rutinas y funciones, donde se desea conservar el estado anterior definido localmente.

usa solo esto

const unsigned char PROGMEM logo16_glcd_bmp[] = {

La verdad es que usaba eso porque es lo que me venía en el código de ejemplo de Adafruit.

Ahora mismo ya lo he conseguido hacer funcionar bien, aunque al meter el bmp en el LCDAssistant parece que me lo deforma un poco, o eso me parece... al menos he podido cuadrar el bmp en el centro.

Este es el código ahora

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

#define NUMFLAKES 10
#define XPOS 0
#define YPOS 1
#define DELTAY 2



#define LOGO16_GLCD_HEIGHT 32
#define LOGO16_GLCD_WIDTH  32 
static const unsigned char PROGMEM logo16_glcd_bmp[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x07, 0xFF, 0xFF, 0xFE, 0x00, 0x0F, 0xFF, 0x00, 0x7F, 0xFF, 0xFF, 0xFF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FF, 0xFF, 0xFF, 0xC0, 0x00, 0x1F, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0x07, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x1F, 0x00, 0x7F, 0xFF, 0xFF, 0xFE, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};


#define SSD1306_LCDHEIGHT 64

#if (SSD1306_LCDHEIGHT != 64)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif

void setup()   {                
  Serial.begin(9600);

  // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3D (for the 128x64)
  // init done
  
  // Show image buffer on the display hardware.
  // Since the buffer is intialized with an Adafruit splashscreen
  // internally, this will display the splashscreen.
  display.display();
  delay(2000);

  // Clear the buffer.
  display.clearDisplay();



}


void loop() {

   // draw a single pixel
  display.drawPixel(0,0, WHITE);
  // Show the display buffer on the hardware.
  // NOTE: You _must_ call display after making any drawing commands
  // to make them visible on the display hardware!
  display.display();
  delay(2000);
  display.clearDisplay();

  display.drawBitmap(0,-15, logo16_glcd_bmp, 128,64,WHITE);
  display.display();
   delay(2000);
  display.clearDisplay();

  display.drawPixel(0,0, WHITE);
  // Show the display buffer on the hardware.
  // NOTE: You _must_ call display after making any drawing commands
  // to make them visible on the display hardware!
  display.display();
  delay(2000);
  display.clearDisplay();
  
}

Bien, sigamos con el proyecto.

Una vez que he conseguido que la pantallafuncione, quiero que muestre un punto cuando le de a un pulsador, y una imagen cuando le vuelva a dar. Tambien he añadido que encienda y apague un LED para controlar que el pulsador funcione.

Este es el código:

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

//#define NUMFLAKES 10
//#define XPOS 0
//#define YPOS 1
//#define DELTAY 2



//#define LOGO16_GLCD_HEIGHT 32
//#define LOGO16_GLCD_WIDTH  32 
static const unsigned char PROGMEM logo16_glcd_bmp[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0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, 0x7F, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x1F, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x20,
0x01, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x1F, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0x07, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x1F, 0x00, 0x7F, 0xFF, 0xFF, 0xFE, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};


#define SSD1306_LCDHEIGHT 64

#if (SSD1306_LCDHEIGHT != 64)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif


const int LED =13;
const int BOTON = 2;
int val = 0; //val se emplea para almacenar el estado del boton
int state = 0; // 0 LED apagado, mientras que 1 encendido
int old_val = 0; // almacena el antiguo valor de val

void setup()   {                
  Serial.begin(9600);

  // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3D (for the 128x64)
  // init done
  // Show image buffer on the display hardware.
  // Since the buffer is intialized with an Adafruit splashscreen
  // internally, this will display the splashscreen.
  display.display();
  delay(2000);

  // Clear the buffer.
  display.clearDisplay();

pinMode(LED,OUTPUT); // establecer que el pin digital es una señal de salida
 pinMode(BOTON,INPUT); // y BOTON como señal de entrada

}


void loop() {


  val= digitalRead(BOTON); // lee el estado del Boton
if ((val == HIGH) && (old_val == LOW)){
state=1-state;
delay(10);
}
old_val = val; // valor del antiguo estado
if (state==1){
 digitalWrite(LED, HIGH); // enciende el LED
 // draw a single pixel
 display.clearDisplay();
 display.drawPixel(0,0, WHITE);
  // Show the display buffer on the hardware.
  // NOTE: You _must_ call display after making any drawing commands
  // to make them visible on the display hardware!
 display.display();
  //delay(2000);
  
}
else{
 digitalWrite(LED,LOW); // apagar el LED
display.clearDisplay();
   display.drawBitmap(0,-15, logo16_glcd_bmp, 128,64,WHITE);
  display.display();
   //delay(2000);
  
}

    
}

Y no, no consigo que funcione.

El pulsador va bien, porque el LED si que enciende, pero la pantalla no responde bien. ¿Hay algo que desconozca?

¿A qué te refieres con no responder bien?
¿De qué color tienes el fondo?
El punto que pintas estará en la parte superior izquierda y de color blanco.

Intenta ser mas descriptivo!! La pantalla no va bien para nosotros es que no funciona y tu dices qeu ya la hiciste funcionar.
Coloca imagenes de lo que va pasando.

Las imagenes deben verse!!

Vale teneis razon.,con lo de que no responde no queda claro.

en el setup sale el logo de adafruit y luego pasas al punto blanco, cambia al punto blanco (si,arriba a la izquierda), pero luego al darle al boton, lo unico que cambia es el led, de encendido a apagado y asi, pero la pantalla ni caso...

Mañana hago alguna foto, pero es que tampoco se que mas explicar jaja

Debe ser algo del código seguro... pero no entiendo que es lo que esta mal :frowning:

Hola.
De momento prueba con esta pequeña modificación a ver si notas algún cambio.

void loop() {
  val= digitalRead(BOTON); // lee el estado del Boton
  if ((val == HIGH) && (old_val == LOW)){
    state=1-state;
    if (state==1){
      digitalWrite(LED, HIGH); // enciende el LED
      // draw a single pixel
      display.clearDisplay();
      display.drawPixel(0,0, WHITE);
      // Show the display buffer on the hardware.
      // NOTE: You _must_ call display after making any drawing commands
      // to make them visible on the display hardware!
      display.display();
      //delay(2000);
    }
    else {
      digitalWrite(LED,LOW); // apagar el LED
      display.clearDisplay();
      display.drawBitmap(0,-15, logo16_glcd_bmp, 128,64,WHITE);
      display.display();
      //delay(2000);
    }
    delay(10);
  }
  old_val = val; // valor del antiguo estado
}

Buenas.
Remonto el post despues de las vacaciones

Ya me funciona lo que quería, es decir, que la darle al botón, cambiase la imagen que se proyecta en la pantalla.
Ahora el siguiente paso es poner un contador. La pantalla muestra un 16, y por cada pulsación en el botón1 debería bajar hasta 0, donde se quede ahi por mas que se pulse el botón1. Para resetear la cuenta habría que pulsar el botón2.

No tenía muy claro como hacerlo, así que he mezclado algunas cosas que sabia, pero sin exito. ¿No se puede hacer así? Porque a mi se me queda la primera imagen que cargo todo el rato, y el botón1 no funciona.

Nota, boton1 uno es el que he llamado buttonstatus, que total, por ahora solo quiero preocuparme de la cuenta atrás.

void setup()   {                
  Serial.begin(9600);
 display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.display();
  delay(2000);

  // Clear the buffer.
  display.clearDisplay();


 pinMode(BOTON,INPUT); // y BOTON como señal de entrada

   display.drawBitmap(0,-15, logo16, 128,64,WHITE);
      display.display();
}
void loop() {
 
     
  if (buttonState != lastButtonState) {
    // if the state has changed, increment the counter
    if (buttonState == HIGH) {
      // if the current state is HIGH then the button went from off to on:
      buttonPushCounter++;
      if (buttonPushCounter==1) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo16, 128,64,WHITE);
        display.display();
        delay(200);
      }
      else if (buttonPushCounter==2) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo15, 128,64,WHITE);
        display.display();
        delay(200);
      }

    } 
    else {
      // if the current state is LOW then the button went from on to off:
         // Delay a little bit to avoid bouncing
    delay(50);
  }
  // save the current state as the last state, for next time through the loop
  lastButtonState = buttonState;

Básicamente mi idea era ponerun contador que contase el botón, y luego según el numoer por el que fuera, asignarle una imagen.

Bueno. Muchas gracias :slight_smile:

¿Y donde tienes digitalRead(BOTON); como en el código anterior?
Si no lees el estado del botón noy hay nada qué hacer.

#define SSD1306_LCDHEIGHT 64

#if (SSD1306_LCDHEIGHT != 64)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif


const int buttonPin = 2;
int buttonPushCounter = 0;   // counter for the number of button presses
int buttonState = 0;         // current state of the button
int lastButtonState = 0;     // previous state of the button


void setup()   {                
  Serial.begin(9600);
 display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.display();
  delay(2000);

  // Clear the buffer.
  display.clearDisplay();


 pinMode(buttonPin,INPUT); // y BOTON como señal de entrada

   display.drawBitmap(0,-15, logo16, 128,64,WHITE);
      display.display();
}


void loop() {

 buttonState = digitalRead(buttonPin);
    if (buttonState != lastButtonState) {
    // if the state has changed, increment the counter
    if (buttonState == HIGH) {
      // if the current state is HIGH then the button went from off to on:
      buttonPushCounter++;
      if (buttonPushCounter==1) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo16, 128,64,WHITE);
        display.display();
        delay(200);
      }
      else if (buttonPushCounter==2) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo15, 128,64,WHITE);
        display.display();
        delay(200);
      }

    } 
    else {
      // if the current state is LOW then the button went from on to off:
         // Delay a little bit to avoid bouncing
    delay(50);
  }
  // save the current state as the last state, for next time through the loop
  lastButtonState = buttonState;


  }

}

este es el codigo entero, obviando la parte en que defino las imagenes que voy a usar. es verdad que no habia puesto l oque comentas.

Ahora tengo que poner un boton2 que me resetea el contador. Lo podría poner como otro else if, si el contador esta en 16 y se pulsa ese boton, que se restee e l contador simplemente.

A ver si lo hago cuando salga de trabajar y lo compruebo :slight_smile:

Gracias

Ha pasado tiempo de esto, pero bueno, es que he estado liado con otros temas...

Tengo un problema y es que con el código anterior, si añado 17 imagenes, que es lo que necesito, me salta el error de que el programa es muy grande.

¿Alguna idea de como mejorarlo?
Yo he estado mirando opciones en internet, pero ninguna me sirve :frowning:

Gracias

Este es el códgio. Obviando al definición de las imágenes, que pondré unejemplo enel siguiente post porque aqui no cabe todo

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);#define SSD1306_LCDHEIGHT 64

#if (SSD1306_LCDHEIGHT != 64)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif


const int buttonPin = 2;
int buttonPushCounter = 0;   
int buttonState = 0;         
int lastButtonState = 0;     


void setup()   {                
  Serial.begin(9600);
 display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.display();
  delay(2000);


  display.clearDisplay();


 pinMode(buttonPin,INPUT); 

   display.drawBitmap(0,-15, logo16, 128,64,WHITE);
      display.display();
}


void loop() {

 buttonState = digitalRead(buttonPin);
    if (buttonState != lastButtonState) {
 
    if (buttonState == HIGH) {
      
      buttonPushCounter++;
      if (buttonPushCounter==1) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo16, 128,64,WHITE);
        display.display();
        delay(200);
      }
      else if (buttonPushCounter==2) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo15, 128,64,WHITE);
        display.display();
        delay(200);
      }
else if (buttonPushCounter==3) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo14, 128,64,WHITE);
        display.display();
        delay(200);
      }

else if (buttonPushCounter==4) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo13, 128,64,WHITE);
        display.display();
        delay(200);
      }
      else if (buttonPushCounter==5) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo12, 128,64,WHITE);
        display.display();
        delay(200);
      }
      else if (buttonPushCounter==6) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo11, 128,64,WHITE);
        display.display();
        delay(200);
      }
      else if (buttonPushCounter==7) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo10, 128,64,WHITE);
        display.display();
        delay(200);
      }
      else if (buttonPushCounter==8) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo09, 128,64,WHITE);
        display.display();
        delay(200);
      }
      else if (buttonPushCounter==9) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo08, 128,64,WHITE);
        display.display();
        delay(200);
      }
      else if (buttonPushCounter==10) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo07, 128,64,WHITE);
        display.display();
        delay(200);
      }
        else if (buttonPushCounter==11) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo06, 128,64,WHITE);
        display.display();
        delay(200);
      }
        else if (buttonPushCounter==12) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo05, 128,64,WHITE);
        display.display();
        delay(200);
      }
        else if (buttonPushCounter==13) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo04, 128,64,WHITE);
        display.display();
        delay(200);
      }
        else if (buttonPushCounter==14) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo03, 128,64,WHITE);
        display.display();
        delay(200);
      }
        else if (buttonPushCounter==15) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo02, 128,64,WHITE);
        display.display();
        delay(200);
      }
        else if (buttonPushCounter==16) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo01, 128,64,WHITE);
        display.display();
        delay(200);
      }
        else if (buttonPushCounter==17) {
        display.clearDisplay();
        display.drawBitmap(0,-15, logo00, 128,64,WHITE);
        display.display();
        delay(200);
         display.clearDisplay();
        display.drawBitmap(0,-15, logo00, 128,64,WHITE);
        display.display();
        delay(200);
         display.clearDisplay();
        display.drawBitmap(0,-15, logo00, 128,64,WHITE);
        display.display();
        delay(200);
         display.clearDisplay();
        display.drawBitmap(0,-15, logo00, 128,64,WHITE);
        display.display();
        delay(200);
      }
    } 
    else {
     
    delay(50);
  }
 
  lastButtonState = buttonState;


  }

}

Y asi defino las imagenes. 17 veces! 17 imagenes...

static const unsigned char PROGMEM logo16[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x07, 0xFF, 0xFF, 0xFE, 0x00, 0x0F, 0xFF, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xC0, 0x0F, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xE0, 0x1F, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x3F, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x01, 0xFE, 0x00, 0x00, 0x07, 0xF8, 0x3F, 0x1F, 0x07, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x7F, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x7E, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0xFC, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x07, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x07, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x07, 0xE0, 0x20,
0x01, 0x01, 0xF8, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x07, 0xC0, 0x00, 0x00, 0x07, 0xE0, 0x20,
0x01, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x20,
0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x20,
0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x1F, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x20,
0x01, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x1F, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x20,
0x01, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x1F, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x20,
0x01, 0x00, 0x07, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x1F, 0x00, 0x7F, 0xFF, 0xFF, 0xFE, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

Entonces, dado que mi problema es de memoria, pensé que sería por las imagenes, pero no...

Probé a eliminar la mitad de los else if, y el programa compiló correctamente. Por lo tanto, el problema es que esta mal optimizada la programación.

Como soy un poco novato con ésto, no se me ocurre como simplificarlo,para que con cada pulsación del botón, cambie la imagen.

Aparte, tengo que añadir otro botón que resetee el contador en cualquier momento

Bueno, quedo a la espera de los sabios, porque yo ya me he quedado sin ideas