diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a461ce..705a365 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,5 +2,7 @@ cmake_minimum_required(VERSION 3.15.0) list(APPEND EXTRA_COMPONENT_DIRS libs/esp-mpu9250/components) +add_compile_definitions(U8G2_WITHOUT_FONT_ROTATION) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(esp-motion-reporter-poc) diff --git a/main/app_main.c b/main/app_main.c index d5662b6..7869ec8 100644 --- a/main/app_main.c +++ b/main/app_main.c @@ -128,15 +128,16 @@ void setup() u8g2_esp32_hal.scl = 22; u8g2_esp32_hal_init(u8g2_esp32_hal); - u8g2_Setup_ssd1306_i2c_128x64_noname_1(&display, U8G2_R0, u8g2_esp32_i2c_byte_cb, u8g2_esp32_gpio_and_delay_cb); + u8g2_Setup_ssd1306_i2c_128x64_noname_f(&display, U8G2_R0, u8g2_esp32_i2c_byte_cb, u8g2_esp32_gpio_and_delay_cb); u8x8_SetI2CAddress(&display.u8x8, 0x3C << 1); u8g2_InitDisplay(&display); u8g2_SetPowerSave(&display, false); - u8g2_ClearBuffer(&display); + u8g2_ClearDisplay(&display); // TODO - u8g2_SetFont(&display, u8g2_font_7x13_tr); - u8g2_DrawStr(&display, 0, 0, "FooBar"); + u8g2_SetFont(&display, u8g2_font_7x13_mr); + u8g2_DrawStr(&display, 10, 10, "FooBar"); + u8g2_SendBuffer(&display); // Setup Wi-Fi char device_name[WIFI_AUTO_PROV_SERVICE_NAME_LEN] = {};