The leJOS Tutorial

| Start of Tutorial > Start of Trail

Trail: Getting Started

# Solutions to the Exercises: Getting Started

Exercise 1: What is leJOS?

- a: a graphical front end for LEGO MINDSTORMS™
- b: an operating system and Java-based language for the RCX
- c: an IDE for the LEGO MINDSTORMS™ programming language
- d: a toolkit for building LEGO MINDSTORMS™ robots

Answer: (b) leJOS is an operating system and Java-based language for the RCX.

Exercise 2: What is the entry point for a leJOS program running on the RCX?

- a: public static void main(String[] args)
- b: public static void initRCXProgram()
- c: public static void mainRCX(RCXParams[] args)

Answer: (a) the entry point for a leJOS program running on the RCX is `public static void main(String[] args)`.

Exercise 3: Where can I find additional information regarding leJOS?
Answer: there are several resources, e.g.

- The leJOS project
- leJOS FAQ pages
- The leJOS discussion forum
- Core LEGO MINDSTORMS Programming by Brian Bagnall
- Programming Lego Mindstorms with Java by Dario Laverde (ed.)

Exercise 4: What is the correct constructor call?

- a: Motor motor = new Motor(Motor.A);
- b: Motor motor = new Motor('A');
- c: Motor motor = new MotorA();
- d: none of these

Answer: (d) the Motor class has no public constructor, but offers several static methods.

Exercise 5: Change the simple sample application so that it displays "LEJOS" on the LCD.
Answer: change the line
`TextLCD.print("DRIVE");`
to
`TextLCD.print("LEJOS");`

Exercise 6: Change the simple sample application so that the motor runs backwards.
Answer: change the line
`Motor.A.forward();`
to
`Motor.A.backward();`

The leJOS Tutorial

| Start of Tutorial > Start of Trail