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
|
|
|
|
#define PIN_RST -1
|
2025-02-13 19:31:11 -05:00
|
|
|
|
2025-02-15 09:40:02 -05:00
|
|
|
// TODO: Can this be static since there can only be one initialization?
|
2025-02-15 17:12:06 -05:00
|
|
|
// TODO: Store RST in I2C and retrieve within SSD instead of the #define
|
|
|
|
I2C i2c(PIN_SDA, PIN_SCL);
|
2025-02-14 16:48:04 -05:00
|
|
|
|
2025-02-13 19:31:11 -05:00
|
|
|
void setup()
|
|
|
|
{
|
2025-02-15 17:12:06 -05:00
|
|
|
SSD1306 ssd1306(i2c.i2c_bus_);
|
|
|
|
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-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() { }
|