// HelloWorld.java // // The usual HelloWorld program, which runs // under LeJOS on the Lego EV3. // // Terry Payne // 25th September 2017 // // We need the LeJOS class that deals with the EV3 Buttons. // One possibility is to use the NXT Button abstraction defined by: // import lejos.hardware.Button; // // In this version we display the message "Hello World", but then pause // (to allow the text to be visible) until the user presses a button. // We use the LCD classes to display text on the LCD screen, as this // is better than simply using System.out.println import lejos.hardware.lcd.LCD; import lejos.hardware.Button; public class HelloWorld { public static void main(String[] args) { LCD.clear(); LCD.drawString("Hello World", 3, 2); System.out.println("Writing into a file"); Button.waitForAnyPress(); LCD.clear(); LCD.drawString("Goodbye", 6, 4); Button.waitForAnyPress(); } }