Showing posts with label Lego. Show all posts
Showing posts with label Lego. Show all posts

Thursday, January 9, 2014

Programming Lego Mindstorms EV3 using LeJOS on Ubuntu Linux

I have been coveting a Lego Mindstorms Robotic kit ever since I learned there was one to be had and learning that the latest version, the EV3 runs Linux was the last straw. I was still hesitant because though the EV3 ran Linux there was no support for programming it in Linux, that is, from a PC running Linux. Out of the box the EV3 can only be programmed using a Windows or Mac machine, and even then only in a GUI suite ("visual programming") geared towards children.

What I needed was the power of a fully-formed language where I could program the EV3 using my Linux desktop (it is what I call my 7 year old laptop that I run only as a box). Lego had chosen to place Linux on the EV3 to make it more hackable and their foresight paid dividends when the LeJOS project was able to fork the open-source Lego kernel allowing them to place a JVM (Java Virtual Machine) and give access to the complete functionality of the EV3 using Java classes. Since I am an Android Developer by day, this was perfect.

The really great thing about the EV3 is that it comes with a micro-SD slot on which you can place your own bootable partition which allows you to change the firmware of the device without actually having to mod it. Basically, write a suitable image to a micro-SD card and the EV3 will boot from it. Remove the sd card and the EV3 will return to booting from the Lego firmware.

The LeJOS project provides a complete tutorial on how to create a micro-sd card that will run LeJOS on the EV3:

Stay tuned for more information on how to use a (supported) Wifi dongle (USB), program the EV3 using IntelliJ and automate the deployment of custom programs using ssh, make and gradle.

Happy hacking on the EV3.