#include <Arduino.h>
#include <U8g2lib.h>
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
/*************************************************
* Pins Layout:
* Input Relay Espresso Bezug = 3
* Input Pin Push Button = 0
* Output Relay Espresso Stop = 4
* Waage Dout = 7
* Waage SCK = 8
* Display SCL =
* Display SDA =
************************************************/
int i = 0;
int a = "G";
U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ SCL, /* data=*/ SDA); // pin remapping with ESP8266 HW I2C
#define Rocket_width 120
#define Rocket_height 27
static unsigned char Rocket_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,0xfe,0xff,0x81,0xff,0x1f,0xf0,
0xff,0xc3,0x07,0x7e,0xfc,0xff,0xf9,0xff,0x07,0xfe,0xff,0xe1,
0xff,0x7f,0xfc,0xff,0xc7,0x07,0x3f,0xfc,0xff,0xf9,0xff,0x07,
0xfe,0xff,0xf3,0xff,0x7f,0xfc,0xff,0xcf,0x87,0x1f,0xfc,0xff,
0xf9,0xff,0x07,0x1e,0xe0,0xf3,0x01,0xf8,0x7c,0x80,0xcf,0xe7,
0x07,0x7c,0x00,0x00,0x3e,0x00,0x1e,0xe0,0xf3,0x01,0xf8,0x3c,
0x00,0xc0,0xff,0x03,0x7c,0x00,0x00,0x3e,0x00,0x1e,0xe0,0xf3,
0x01,0xf8,0x3c,0x00,0xc0,0xff,0x01,0xfc,0xff,0x01,0x3e,0x00,
0xfe,0xff,0xf1,0x01,0xf8,0x3c,0x00,0xc0,0xff,0x03,0xfc,0xff,
0x01,0x3e,0x00,0xfe,0xff,0xf1,0x01,0xf8,0x7c,0x80,0xcf,0xe7,
0x07,0x7c,0x00,0x00,0x3e,0x00,0xfe,0xff,0xe3,0xff,0x7f,0xfc,
0xff,0xcf,0x87,0x1f,0x7c,0x00,0x00,0x3e,0x00,0x1e,0xe0,0xe3,
0xff,0x7f,0xfc,0xff,0xcf,0x07,0x3f,0xfc,0xff,0x01,0x3e,0x00,
0x1e,0xe0,0xc3,0xff,0x3f,0xf8,0xff,0xc7,0x07,0xfe,0xfc,0xff,
0x01,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0x07,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x1e,0x1c,0x1e,0x1e,0x1e,0x1c,0x3c,0x3c,0x80,0x10,0x22,0xc0,
0x20,0xc2,0x03,0x02,0x02,0x32,0x12,0x02,0x02,0x02,0x42,0x80,
0x19,0x22,0xe0,0x61,0x22,0x04,0x1e,0x1e,0x1e,0x1e,0x1e,0x1e,
0x3e,0x42,0x80,0x1f,0x22,0x20,0xa1,0x22,0x04,0x02,0x10,0x02,
0x0a,0x02,0x10,0x20,0x42,0x80,0x16,0x22,0xf0,0x23,0x23,0x04,
0x1e,0x0e,0x02,0x12,0x1e,0x0e,0x1e,0x3c,0x80,0x10,0xe2,0x13,
0x22,0xc2,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};
void setup() {
u8g2.begin();
}
void loop() {
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
u8g2.drawXBM( 4, 2, Rocket_width, Rocket_height, Rocket_bits); // Draw Rocket Espresso Logo
u8g2.sendBuffer(); // transfer internal memory to the display
delay(1000);
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_luBS18_te); // choose a suitable font
u8g2.drawStr(0,19,"HALLI HALLO");
u8g2.setFont(u8g2_font_saikyosansbold8_8u); // choose a suitable font
u8g2.setCursor(15,30);
u8g2.print(i);
u8g2.print("G");
u8g2.sendBuffer(); // transfer internal memory to the display
delay(1000);
}