I built several variants of this machine, because my childrens are very interested to examine these machines in detail, even they do not understand the programming part.
The basic idea is: A motor driven mixer moves down into a drink (e.g. milk with cacao powder), mixes the drink and then moves back up to the origin position.
The program is very trivial, only about 10 lines of code. So I'm sure there is no need to post it here. This machine is less interesting to adult persons, but very interesting to small childrens (in my case 4 and 7 years). The can compare different mechanical constructions that dad builds and discuss them. My son was suprised to see that the machine does nothing without a computer attached to it and a program that control the computer. That was a good start for me to explain, waht a computer really does (it can do more than play Youtube clips).
Both children explained what they saw and how they think that thing works. Also both reported their own ideas for modifcation.
So If you want to let small childrens understand what you are doing with Lego and why you spend hours in front of the computer typing text that is obviously somehow related to the Lego parts, try this one. Even small childrens understand the purpose of that machine and how it works (basically). And they drink a lot now
