O'Reilly logo

Lego Mindstorms EV3 Essentials by Abid H. Mujtaba

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Hello, World EV3 program

So, now we come to the task of the hour: writing a Hello, World program for EV3, which when executed, displays the string Hello, World on the LCD screen of EV3 and exits when any hardware button is pressed. We start by creating the project directory structure inside the lejos top-level folder. We will create a HelloWorld folder containing the ev3 subfolder, a src subfolder, and the build.gradle file. We add a HelloWorld.java file to src. The project's folder now looks as follows:

HelloWorld
    | ---- ev3
    |         | ---- DBusJava
    |         | ---- ev3classes
    |
    | ---- build.gradle
    |
    | ---- src
              | ---- HelloWorld.java

The HelloWorld.java program

Let's begin by taking a look at the HelloWorld.java program in full and then I will explain it line ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required