My littlevgl adventure :)

Hi all,
Just want to share what i got so far after less than two weeks with little vgl.
image

This tool just made creating the layout fun. And to think that I have very little non formal programming background this is already a feat for me.

Now i just hope i dont get stucked making this functional.

Best regards to all.

1 Like

Looks great. nice work.

Very impressive, especially after only a couple weeks! I was not nearly as efficient with my time, but to be fair to myself I was also working on adding functionality simultaneously with the design :slight_smile:

Great work!
Can you send a closer picture and write some words about your project?


Thanks @kisvegabor.
This is for a cnc laser machine i am building. Ill be loading grbl on it and i was thinking why not make it work autonomously without tying a pc or rpi or a phone to it.
I have too much time to spare so learning some new skills, maybe programming, is a good way to spend my days.

1 Like

Cool project! Thanks for sharing! :slight_smile:

It would be awesome if i can get it working. Thanks for all the help this group had been giving me. Couldnt make it this far without your guys’ help. Especially you and @embeddedt. Please help me all the way. Hahah.
Regards. :smiley:

1 Like

Hi all,

Update: i have all the functions done for all the objects (buttons, button maps, dropdown lists, scroll bars, etc.). All of them working as i expected them to. The stepper motors they need to move responds on the commands.

I however have one general issue. Hope somebody can help. This might not be the right forum to ask it. Apologies in advance. (Maybe point me to a better forum to ask it.)

The main problem i have is after sending a command, whether using the text area or buttons, i can only send that only one command and the stepper motors would not respond anymore. The commands are just basically text gcode commands. Anybody got any idea what i might have missed? Or maybe im doing something wrong. Thanks in advance.

Do you think it’s related to LittlevGL?

hi gabor,

its a posibility. but im not really sure.

But for these lines of code, i expect to get a string no?

            strcpy (&GCode[strlen(GCode)], "G90G21X");
            strcat (&GCode[strlen(GCode)], travelDist);
            strcat (&GCode[strlen(GCode)], "F");
            strcat (&GCode[strlen(GCode)],FR);

            report_status_message(gc_execute_line(GCode, CLIENT_ALL),CLIENT_ALL);

travelDist and FR being char variables.

I have just tested the program and learned that even after sending commands thru the lvgl GUI, sending commands thru a serial terminal still makes the motors move.

Codes sent to the machine are actually just text strings. Above code should result to something like “G90G21X-12.5F250”. No spaces in between. so i am thinking that there is something wrong with my text string. its’ termination or something else.

have a nice weekend.

ps. after posting my project on a number of fb groups, i got lots of inquiry what driver or library i used. of course i told them about littlevgl. hope they try this soon. :smiley:

strcpy and strcat are C functions, not LittlevGL functions. Have you tried using a debugger to see the contents of the GCode buffer after calling each function? That should lead you to the problem quickly.

1 Like

Thanks. Will do just that. unfortunately i will have to wait for my order of a jtag debugger.

I suggest trying something like this.

sprintf(GCode, "G90G21X%sF%s", travelDist, FR);

sprintf is an awesome function for creating a string with variable input(s). The %s tags you see in there are just like you’d use in a printf statement and represent a character string. Note that this will only work if they are terminated with \0 characters (e.g., travelDist should contain ‘12.5\0’).

You also need to be certain that GCode has enough room to hold the entire ‘string’ or you may receive a segfault or other undesired behavior.

1 Like

Almost done. Here’s a video showing the thing working:

1 Like