Code Your Legos

David Luders on Flickr

Learn some nifty coding tricks while creating a Formula EV3 Race Car.

Bringing Legos to Life with Code

Have you ever wished that you could bring your favorite Lego creations to life? Maybe not to life in the way that a plant or animal is alive, but at least to see them move across the room on their own, react to their environment, or even just to make a little noise? The Lego EV3 set allows us to do just that.

What Distinguishes EV3 from other Lego Sets?

For starters, the home EV3 set contains over 600 pieces, mostly similar to those in the Lego Technic line. However, it also includes a set of sensors (infrared sensor, color sensor, and touch sensor) and a “brain”. The brain is actually a small computer that connects to a laptop or PC with a USB cord and allows programs written on your computer to be downloaded to any EV3 project!

How Does it Work?

Through code, we can program motors to rotate at varying speeds, obstacles can be detected, and beginners as well as experienced coders can transfer their programs from a computer to a Lego robot. Although Lego created its own drag and drop language for the EV3 set, it shares many of the features of a standard, text-based, language. As such, when we program an EV3 robot we develop algorithms that include looping, conditional logic, variables, and math, and we can even write our own functions.


Become a subscriber and get access to the rest of this article. Plus all our magazine articles.

Stories also include numerous links to help parents, kids, and teachers learn more. Get access today at just $15 per year!

Subscribe Today!

Also In The December 2017 Issue

Building and creating your tools with the Minecraft toolbox helps you survive the game.

Sensors give robots the senses humans have.

30+ ideas for all age holiday gifts, from books to apps to board games to VR and more.

There might be a reason that too-real robot and video game character creeps you out.

This programming language uses colors instead of text and punctuation to add and perform other tasks.

Knowing how passwords are cracked can help you create better passwords.

There are a number of strategies teachers (plus parents and students) can take to learn programming.

This project uses conductive thread to create a glove to activates your phone.

Software programming does neat things with language, in this case, mixing capital letters.

This Scratch game has lots of ways you can customize the game play. No cats were harmed in the making of this article either.

Links from the bottom of all the October 2017 articles, collected in one place for you to print, share, or bookmark.

Interesting stories about computer science, software programming, and technology for October 2017.