Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BSP_DISCO_F746NG
main.cpp
00001 //Notebook page https://os.mbed.com/users/JohnnyK/notebook/how-start-with-the-littlevgl/ 00002 #include "mbed.h" 00003 #include "lvgl/lvgl.h" 00004 #include "lv_port_disp.h" 00005 #include "lv_port_indev.h" 00006 #include "lv_examples/lv_examples.h" 00007 00008 Ticker ticker; //Ticker for lvgl 00009 00010 //Callback function for lvgl timing. 00011 void lv_ticker_func(){ 00012 lv_tick_inc(10); 00013 //Call lv_tick_inc(x) every x milliseconds in a Timer or Task (x should be between 1 and 10). 00014 //It is required for the internal timing of LittlevGL. 00015 lv_task_handler(); 00016 //Call lv_task_handler() periodically every few milliseconds. 00017 //It will redraw the screen if required, handle input devices etc. 00018 } 00019 00020 int main() 00021 { 00022 printf("LittlevGL GUI-"); 00023 lv_init(); //Initialize the LittlevGL 00024 lv_port_disp_init(); //Initialize diplay 00025 lv_port_indev_init(); //Initialize touchpad 00026 ticker.attach(callback(&lv_ticker_func), 10ms); //Attach callback to ticker 00027 00028 lv_demo_widgets(); 00029 00030 while(1) { 00031 //do something 00032 thread_sleep_for(100); 00033 } 00034 }
Generated on Tue Jul 12 2022 23:49:15 by
 1.7.2
 1.7.2