Cage the elephant

Ain’t no rest for the wicked

As promised before, we’ve continued our work on Elephant droid pursuing the true potential of the EV3 system. Only after few additional hours of building, the Elephant droid was completed and it just looks majestic.

We’ve started programming it straight away and we were positively surprised how powerful and easy to use the EV3 software is. Making loops and conditions is as user friendly as it gets, thanks to the colorful blocks that represent different variants of control flow. User also can manage program state by introducing variables and within minutes we were able to get our Elephant moving. We’ve manage to teach him how to: walk forward, walk backward, toot, move trunk up and down, move head up and down.

Image is worth more than a thousand words, so see it for yourself:

Another brick in the wall

To give our monster new abilities, like making sounds and walking, we’ve used developed by Lego tools downloaded from:


That’s the whole Elephant program:

Whole programm


This doesn’t necessary tell you what’s what, so let’s break it down. The Reset macro is the essential part, where our Elephant returns to his main state. Without it we could end up in a situation where the mechanical parts would not be aligned correctly to perform different tasks (i.e. moving forwad). It’s worth to mention, that LabView software allows us to create subprograms (like mentioned Reset macro) that we can re-use in the different part of the project. That’s saves us a lot of time and effort and makes the project more modular.

Reset makro
Color sensor looking for red brick

Those blocks mean:

· move head until sensor will see red color

· stop moving head

· move trunk up until there’s contact

· stop moving the trunk

· play sound

· wait one second

· move head down, move trunk down (simultaneously)

Rest of the program focus was directed on buttons that are available on the mindstorm brick.

We’ve programmed those four buttons

Up button

Walk forward

· play sound

· wait one second

· increment counter that will be utilised in ‚walking module’ as ‚go forward’

· wait for input

Down button

Walk backward

· play sound

· wait one second

· decrement counter that will be utilised in ‚walking module’ as ‚go backward’

· wait for input

Left button

Move head and trunk, honk :)

· make servomotor move until contact(move head)

· move trunk

· reset macro


Finally what is left is walking (with some serious math included :)).

Look at that math!

Steady as she goes

Aside from the official projects supported by Lego, like the Elephant, we made an in-depth look at the community tools because we are facing a greater challenge that all of mentioned above. We want to build a machine that will allow us to program in Swift language. The standard EV3 software is ok, but we want to make use of all our experience and proficiency in coding and using tools to do even greater things. We found a dedicated linux distribution called EV3dev, that’s based on Debian. We need to build a toolchain for producing Swift applications that will run on EV3, and since there’s nothing like it available, we are going to make it on our own!

But first things first. We were able to install EV3dev on mindstorm brick and get an ssh session on it.

I’m in!

Next we’ve checked out our tools:

What we have here?

And start installing all familiar software via apt-get command. Our plan is to compile swift via crosscompiler for TI Sitara AM1808 (ARM926EJ-S core) which is the heart of EV3 central brick. Then we going to compile whole Swift toolchain for fully functional Swift on EV3. Finally we would be able to create a framework that will give us full control of all I/O of the EV3(like servomotors, sensors etc.) and then… sky is the limit!

Stay tuned for more updates of our Lego Mindstorms Guild!

Like what you read? Give Lego Mindstorm Guild a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.