Hailfire Droid

Post your NXJ projects, project ideas, etc here!

Moderators: imaqine, 99jonathan, roger

New User
Posts: 15
Joined: Sun Jan 25, 2009 1:36 am
Location: Houston

Hailfire Droid

Postby mabusincarnate » Tue Feb 03, 2009 6:03 pm

I just finished my first "original" project so I thought I'd get some feedback. I took my inspiration from a guy on NXTLog, though I built this entirely on my own.

This is the first code I've written since high school computer science so it doesn't really do much. I'm using the tutorials on sun.com and learning as I go.


Code: Select all

package org.me.mypackage;

import lejos.nxt.*;

public class HelloWorld {

   public static void main(String[] args) {
      UltrasonicSensor sonic = new UltrasonicSensor(SensorPort.S1);
      int distance = sonic.getDistance();
            if(distance >= 25) {   
               distance = sonic.getDistance();
            else {
               distance = sonic.getDistance();
   public static void backUp(){

Return to “NXJ Projects”

Who is online

Users browsing this forum: No registered users and 2 guests