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

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

With binary search, you don’t have to be a mind reader to beat this simple coding activity.

Controllers have come a long way in 50 years. Let’s appreciate the bulky, awkward ancestors that led us here!

Take your Scratch games to the next level by adding multiple modes with multiple sprites.

Let the CSS Zen Gardens wow you with variety and elegance. Making a pretty website isn’t so complicated after all!

An introduction to a hip new alternative to Java. It’s all the rage in android development!

Resources to transform you into a web virtuoso, from messaging apps to testers to code converters.

New treasures and new enemies await in two unique, dangerous realms.

Create your own 3D digital museum and learn how you can help preserve cultural artifacts.

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

Add data types to your new programming language in this third installment of the series.

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