Shaun Reed 164af20d56 Fix dependencies for each component.
Add ability to clear LCD screen, and write at a label position.
2025-11-02 16:43:35 -05:00

36 lines
1.3 KiB
C++

/*#############################################################################
## Author: Shaun Reed ##
## Legal: All Content (c) 2025 Shaun Reed, all rights reserved ##
## ##
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com ##
##############################################################################
*/
#include "main.h"
#include "i2c.h"
#include "lcd.h"
#include "ssd1306.h"
extern "C" void app_main(void)
{
I2C_init(PIN_SDA, PIN_SCL);
IPanelDevice lcd = SSD1306_new();
LCD d = LCD_init(&lcd);
LCD_set_text_with_mode(&d, "Test test 12345678910", LV_LABEL_LONG_SCROLL,
LV_ALIGN_CENTER);
LCD_set_text(&d, "Hello hello hello hello hello hello hello hello!");
LCD_set_text_with_mode(&d, "A random sentence with no meaning at all.",
LV_LABEL_LONG_CLIP, LV_ALIGN_BOTTOM_MID);
sleep(1);
LCD_clear(&d);
LCD_set_text(&d, "Test clearing the screen");
LCD_set_text_with_mode(&d, "Test writing something and overwriting it",
LV_LABEL_LONG_SCROLL, LV_ALIGN_CENTER);
LCD_set_text_at(&d, "Overwrite.", 1);
}