Why is there no MicroPython code example in the latest official documentation, only C code?

I am at the latest official document link:“ Examples — LVGL documentation -Unable to find sample code for micropython for ‘started’

Because the LGVL project is based on C, so it´s fully normal.

Here is the doc for LV Micropython: Micropython — LVGL documentation

You were expecting Python, but LVGL Micrpython is a separate project that merely wraps C calls into Python functions, reusing the same API structure, so it´s pretty easy to take a C example and write Python code. Got a full, complex code building an UI and you want it in Python ? Ask ChatGPT for translation :slight_smile:

You haven’t solved the problem I raised, so are you a robot?

I´m afraid I cannot answer, Davhen

1 Like

As our “robot” friend ACBIAS already said: LVGL is based on C, hence all the examples are in C. I think there are no examples using Micropython simply because no one has bothered making them yet.

The latest documentation “Welcome to the documentation of LVGL! — LVGL documentation” and official examples “https://github.com/lvgl/lvgl/tree/master/examples” both used to contain Micropython examples, but now I see they’ve been removed. Note that they have been removed, meaning they were previously present but have since been deleted. I’m not sure why the Micropython code examples were removed; could it be due to compatibility issues with the latest version or some other reason?

I see. I do know that the bindings have changed for V9 so perhaps the examples just are not updated yet.

Maybe it’s like this, I’ll have to wait for further updates or related announcements, because I only know micropython and not c, which has increased my learning costs a lot for me

was removed : The “robot” could not understand the (presumably) human because of missing information: could not infer that the examples were REMOVED.

I understand your frustration, but as I wrote earlier: you can easily transpose any example to C to Micropython since all (ok: almost) functions are the same. behave the same, have the same name.

And the tedious task of formatting from C to Python, as I wrote earlier, can be done without efforts by a conversational bot like ChatGPT.

It works wonders. I was in the same exact place than you and that´s what i did: i gave the github link (specifiy the right branch) to ChatGPT and asked him to translate all functions using LVGL to micropython.

But of course if you have a grief against robots, you can take it as a Zen exercise: tabulating and removing ( ) ; you can do it yourself.

Robots are not much different than humans: If you cannot formulate your question properly, you´ll yield only answers that will leave you unsatisfied.

Regards,

your biobot ACBIAS.

That is because The MicroPython binding is no longer interwoven with LVGL. LVGL having a dependency on the binding working properly was hindering development of LVGL. The 2 needed to be separated in order to allow LVGL to grow.

The MicroPython binding has to play catch up with things that should have been done a long time ago. Like having it’s own documentation with a properly mapped out API. This is being worked on, It is a very large task to complete. Sorry for the inconvenience. You have to trust me when I say that the end result is going to be way better. One of the additions is going to be having a stub file generated which will greatly air in development when using an IDE like VSCode or PyCharm. All of the nifty IDE features like built in documentation, code completion and type hinting will work properly.

There is a lot of planing involved with it so that there is a common system that any binding will be able to use.

Hello, kdschlosser, thank you very much for your patient answer. This is the answer I was looking for. I will wait for the completion of this task, and at the same time, I appreciate the contributions you have made for this, and look forward to your final results.

Hello,

I’ve just read the discussion and I’m wondering what I’m using ???
However, I use lvgl v9
My example

I don’t think I understand the difference

Can you please explain ?

Thank you

You can start by trying to use LVGL v8 and referring to the relevant documentation, such as “Welcome to the documentation of LVGL! — LVGL documentation”. Transition to the latest version after LVGL v9 is fully developed. Currently, it seems that the binding and compilation parts of Micropython LVGL v9 are still being improved. Of course, this is just a personal suggestion. If you have other professional questions, you can post them on the forum to ask other knowledgeable individuals.