You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, please help me!!!
I run esp32-smartdisplay-demo and working fine! But when i add line lv_disp_set_rotation(disp, LV_DISPLAY_ROTATION_90);, screen do not display anything
#include<Arduino.h>#include<esp32_smartdisplay.h>#include<ui/ui.h>voidOnAddOneClicked(lv_event_t*e)
{
staticuint32_tcnt=0;
cnt++;
lv_label_set_text_fmt(ui_lblCountValue, "%u", cnt);
}
voidOnRotateClicked(lv_event_t*e)
{
auto disp=lv_disp_get_default();
auto rotation= (lv_display_rotation_t)((lv_disp_get_rotation(disp) +1) % (LV_DISPLAY_ROTATION_270+1));
lv_display_set_rotation(disp, rotation);
}
voidsetup()
{
#ifdefARDUINO_USB_CDC_ON_BOOTdelay(5000);
#endifSerial.begin(115200);
Serial.setDebugOutput(true);
log_i("Board: %s", BOARD_NAME);
log_i("CPU: %s rev%d, CPU Freq: %d Mhz, %d core(s)", ESP.getChipModel(), ESP.getChipRevision(), getCpuFrequencyMhz(), ESP.getChipCores());
log_i("Free heap: %d bytes", ESP.getFreeHeap());
log_i("Free PSRAM: %d bytes", ESP.getPsramSize());
log_i("SDK version: %s", ESP.getSdkVersion());
smartdisplay_init();
__attribute__((unused)) auto disp=lv_disp_get_default();
lv_disp_set_rotation(disp, LV_DISPLAY_ROTATION_90);
// lv_disp_set_rotation(disp, LV_DISP_ROT_180);// lv_disp_set_rotation(disp, LV_DISP_ROT_270);ui_init();
// To use third party libraries, enable the define in lv_conf.h: #define LV_USE_QRCODE 1
auto ui_qrcode=lv_qrcode_create(ui_scrMain);
lv_qrcode_set_size(ui_qrcode, 100);
lv_qrcode_set_dark_color(ui_qrcode, lv_color_black());
lv_qrcode_set_light_color(ui_qrcode, lv_color_white());
constchar*qr_data="https://github.com/rzeldent/esp32-smartdisplay";
lv_qrcode_update(ui_qrcode, qr_data, strlen(qr_data));
lv_obj_center(ui_qrcode);
}
ulongnext_millis;
auto lv_last_tick=millis();
voidloop()
{
auto constnow=millis();
if (now>next_millis)
{
next_millis=now+500;
chartext_buffer[32];
sprintf(text_buffer, "%lu", now);
lv_label_set_text(ui_lblMillisecondsValue, text_buffer);
#ifdefBOARD_HAS_RGB_LED
auto constrgb= (now / 2000) % 8;
smartdisplay_led_set_rgb(rgb&0x01, rgb&0x02, rgb&0x04);
#endif#ifdefBOARD_HAS_CDS
auto cdr=analogReadMilliVolts(CDS);
sprintf(text_buffer, "%d", cdr);
lv_label_set_text(ui_lblCdrValue, text_buffer);
#endif
}
// Update the tickerlv_tick_inc(now-lv_last_tick);
lv_last_tick=now;
// Update the UIlv_timer_handler();
}```
Iwanttogetusedtorotatingthescreenformyfutureprojects.
The text was updated successfully, but these errors were encountered:
Hello, please help me!!!
I run esp32-smartdisplay-demo and working fine! But when i add line
lv_disp_set_rotation(disp, LV_DISPLAY_ROTATION_90);
, screen do not display anythingThe text was updated successfully, but these errors were encountered: