Monkey
The Monkey module provides LVGL applications with a simple monkey test. Monkey Testing is a technique where the user tests the application or system by providing random inputs and checking the beha...
The Monkey module provides LVGL applications with a simple monkey test. Monkey Testing is a technique where the user tests the application or system by providing random inputs and checking the behavior or seeing whether the application or system will crash. This module provides this service as simulated random input to stress test an LVGL application.
Usage
First, enable LV_USE_MONKEY in lv_conf.h.
Next, declare a variable (it can be local) of type lv_monkey_config_t to
define the configuration structure, initialize it using
lv_monkey_config_init(cfg) then set its type member to the desired
type of input device, and set the min and max values for its
period_range and input_range members to set the time ranges (in milliseconds)
and input ranges the Monkey module will use to generate random input at random times.
Next, call lv_monkey_create(cfg) to create the Monkey. It returns a
pointer to the lv_monkey_t created.
Finally call lv_monkey_set_enable(monkey, true) to enable Monkey.
If you want to pause the monkey, call
lv_monkey_set_enable(monkey, false). To delete it, call
lv_monkey_delete(monkey).
Note that input_range has different meanings depending on the type input device:
LV_INDEV_TYPE_POINTER: No effect, click randomly within the pixels of the screen resolution.LV_INDEV_TYPE_ENCODER: The minimum and maximum values ofenc_diff.LV_INDEV_TYPE_BUTTON: The minimum and maximum values ofbtn_id. Uselv_monkey_get_indevto get the input device, and uselv_indev_set_button_pointsto map the key ID to the coordinates.LV_INDEV_TYPE_KEYPAD: No effect, Send random Keys.
Examples
Touchpad monkey example
Encoder monkey example
Button monkey example
API
How is this guide?
Last updated on
Logging
LVGL has a built-in Logging module to inform the user about what is happening in the library.
Widget ID
Widgets can optionally have identifiers added to their functionality if needed for the application. Exactly how that happens is designed to be flexible, and can morph with the needs of the applicat...