2025-02-14 15:02:49 -05:00
|
|
|
#include "display.h"
|
2025-02-15 17:12:06 -05:00
|
|
|
#include "ssd1306.h"
|
|
|
|
|
|
|
|
// Pin may vary based on your schematic.
|
|
|
|
#define PIN_SDA GPIO_NUM_21
|
|
|
|
#define PIN_SCL GPIO_NUM_22
|
2025-02-16 07:21:16 -05:00
|
|
|
#define PIN_RST (-1)
|
2025-02-13 19:31:11 -05:00
|
|
|
|
2025-02-15 17:44:58 -05:00
|
|
|
I2C i2c(PIN_SDA, PIN_SCL, PIN_RST);
|
2025-02-14 16:48:04 -05:00
|
|
|
|
2025-02-13 19:31:11 -05:00
|
|
|
void setup()
|
|
|
|
{
|
2025-02-15 18:16:25 -05:00
|
|
|
SSD1306 ssd1306(i2c);
|
2025-02-15 18:26:26 -05:00
|
|
|
Display d(ssd1306);
|
2025-02-13 19:31:11 -05:00
|
|
|
|
2025-02-14 17:19:13 -05:00
|
|
|
d.set_text("Test test 12345678910",
|
|
|
|
"test-text1",
|
|
|
|
LV_LABEL_LONG_SCROLL,
|
|
|
|
LV_ALIGN_CENTER);
|
2025-02-14 15:50:35 -05:00
|
|
|
|
2025-02-16 11:24:35 -05:00
|
|
|
d.set_text("Test test changing text",
|
|
|
|
"test-text1",
|
|
|
|
LV_LABEL_LONG_SCROLL,
|
|
|
|
LV_ALIGN_CENTER);
|
|
|
|
|
2025-02-14 17:19:13 -05:00
|
|
|
d.set_text("Hello hello hello hello hello hello hello hello!", "test-text2");
|
2025-02-14 15:56:15 -05:00
|
|
|
|
2025-02-14 17:19:13 -05:00
|
|
|
d.set_text("A random sentence with no meaning at all.",
|
|
|
|
"test-text3",
|
|
|
|
LV_LABEL_LONG_CLIP,
|
|
|
|
LV_ALIGN_BOTTOM_MID);
|
2025-02-13 19:31:11 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void loop() { }
|