Hola compañeros, despues de conseguir lo de las pulsaciones queria poner un logo y para probar cogi uno de un programa que tenia echo, el caso es que no consigo entender como funciona y entonces no lo hago funcionar. La libreria que ehe escogido por las posibilidades mas amplias que ofrece es la u8g2
Haber si alguien que entendiese de esto un poco me puede echar una mano. Gracias
#include <Arduino.h>
#include <U8g2lib.h>
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
void setup(void) {
pinMode(9, OUTPUT);
digitalWrite(9, 0); // default output in I2C mode for the SSD1306 test shield: set the i2c adr to 0
u8g2.begin();
}
#define u8g_logo_width 128
#define u8g_logo_height 64
static unsigned char u8g_logo_bits[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0xC0,0xC0,0xC0,0xE0,0x60,0x60,0x60,0x60,0x70,0x30,0x30,
0x30,0x70,0x60,0x60,0x60,0x60,0xE0,0xC0,0xC0,0x40,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x03,0x06,0x0C,0x3C,0x78,0xC8,0x98,0x98,0x98,0x98,0x98,0x98,0x98,
0x98,0x98,0x98,0x98,0x98,0x98,0x88,0xC8,0x49,0x49,0x49,0x49,0x49,0x48,0x4A,0x0A,
0x2A,0x3C,0xF4,0xC0,0x00,0x00,0x3C,0x74,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
0x08,0x30,0x80,0x40,0x20,0x91,0xCC,0xC0,0xE0,0xE0,0xE0,0xF0,0xF0,0xF0,0xF0,0xF0,
0xF0,0xF0,0xF0,0xF0,0xE0,0xE0,0xE0,0xC0,0xC0,0x8D,0x01,0x00,0x40,0x00,0x10,0x08,
0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xE0,0x3C,0x2C,0x00,0x00,0xC0,0xF4,0x2C,0x2A,
0x4A,0x4A,0x49,0x49,0x49,0x49,0x49,0x49,0xC8,0x88,0x98,0x98,0x98,0x98,0x98,0x98,
0x98,0x98,0x98,0x98,0x98,0x98,0xC8,0x48,0x78,0x3C,0x04,0x07,0x03,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x04,0x1C,0x38,0x38,
0x68,0x4C,0xCC,0xCC,0xC4,0x44,0x44,0x64,0x24,0x22,0x22,0x32,0x12,0x12,0x91,0x89,
0xC9,0x49,0x4C,0x25,0x27,0x14,0x98,0xB8,0x61,0x65,0xC3,0xC6,0x84,0x8C,0x0C,0x9E,
0xF9,0xFC,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,0xFB,0x01,0x00,0x00,0x00,0x78,0xFC,0xFC,
0xFC,0x78,0x00,0x00,0x01,0x03,0xC7,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0xFD,0xF8,0xFA,
0x1C,0x08,0x8C,0x86,0xCE,0xC3,0x65,0x61,0x98,0x98,0x14,0x27,0x25,0x48,0x49,0x89,
0x99,0x91,0x12,0x12,0x32,0x22,0x22,0x24,0x64,0x44,0x44,0xC4,0xCC,0x4C,0x6C,0x68,
0x38,0x38,0x0C,0x04,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0x01,0x03,0x02,0x02,0x06,0x0E,0x0A,0x0B,0x09,0x09,0x18,0x38,
0x24,0x24,0x22,0x32,0x31,0x79,0x48,0x64,0x22,0x73,0xD9,0xCD,0x67,0x73,0x8B,0x8F,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x00,0x00,0x00,0x00,0x70,0xF8,0xFC,
0xFC,0xF8,0x30,0x00,0x00,0x03,0x07,0x8F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xCF,
0x87,0xDB,0x73,0x67,0xC9,0xD1,0x73,0x26,0x64,0x48,0x79,0x30,0x32,0x20,0x24,0x24,
0x38,0x18,0x09,0x09,0x0B,0x0A,0x0E,0x06,0x02,0x02,0x03,0x01,0x01,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,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,0x0F,0x1C,0x78,0xE0,0xC0,
0x80,0x00,0x03,0x07,0x0F,0x0F,0x1F,0x9F,0x7E,0x3C,0xFC,0x78,0xF8,0x78,0xF8,0x78,
0xF8,0x78,0xF8,0x7C,0x7C,0x3E,0x7E,0x9F,0x1F,0x0F,0x0F,0x07,0x03,0x01,0x80,0xC0,
0xE0,0x78,0x3C,0x0F,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
0x03,0x03,0x06,0x0E,0x0C,0x1C,0x22,0x21,0x38,0x47,0x40,0x7C,0x01,0x40,0x7F,0x80,
0x4F,0x40,0x00,0x7C,0x60,0x43,0x38,0x21,0x22,0x1C,0x0C,0x0E,0x06,0x03,0x03,0x01,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
void loop(void) {
u8g2.clearBuffer();
u8g2.setDrawColor(1);
u8g2.drawBitmap( 0, 0, u8g_logo_width, u8g_logo_height, u8g_logo_bits);
u8g2.sendBuffer();
delay(1000);
}