Questions tagged [lejos-nxj]

leJOS (pronounced like the Spanish word "lejos" for "far") is a tiny Java Virtual Machine. In 2006 it was ported to the LEGO NXT brick.

leJOS (pronounced like the Spanish word "lejos" for "far") is a tiny Java Virtual Machine. In 2006 it was ported to the LEGO NXT brick.

leJOS NXJ includes all the classes in the NXJ API as well as the tools used to upload code to the NXT brick.

leJOS NXJ offers the following:

  • Object-oriented language (Java)
  • Preemptive threads (tasks)
  • Arrays, including multi-dimensional
  • Recursion
  • Synchronization
  • Exceptions
  • Most of the java.lang, java.util and java.io classes
  • A well-documented Robotics API
73 questions
1
vote
5 answers

Is it standard behavior for this code to throw a NullPointerException?

I've had a big problem in some library code, which I've pinned down to a single statement: System.out.println((String) null); Ok, the code doesn't actually look like that, but it certainly calls println with a null argument. Doing this causes my…
Eric
  • 95,302
  • 53
  • 242
  • 374
1
vote
2 answers

Android Threads with infinite loops and UI

I am fairly new to Android and I didn't get the Android threading idea yet. Here I have BtConnection class which communicates with Lego NXT via Bluetooth. I want to change my webView according to message from NXT. I want to change webView as soon as…
Ilgiz Mustafin
  • 414
  • 1
  • 4
  • 15
1
vote
1 answer

Running SimpleOpenNI and leJOS in same project

We have a project in which we want to control a Lego Mindstorms robot with the Microsoft Kinect sensor. We decided to use SimpleOpenNI with Processing to read the sensor and leJOS to control the robot for a simple reason: since both is in Java, we…
Valentino Ru
  • 4,964
  • 12
  • 43
  • 78
1
vote
1 answer

LeJOS extension for NetLogo

I am new to Lejos and have a short question.Is there any LeJOS extension to combine with NetLogo? I need to run Lejos with Netlogo and plugged both of them into Eclipse.But I cant use Netlogo as I wanted in java.So I want to know whether it is…
Ecrin
  • 246
  • 5
  • 21
0
votes
2 answers

Besides reinstalling Eclipse 32 bit is there a way around using a -d32 flag on a JVM from a mac with os x 10.6.8?

Essentially I am trying to use the lejos runtime along with lejos libraries for a project and so I get the error from my Eclipse nxt_project that I do not have the NXTCommException class. I did some research and apparently I can only run my project…
Nightvein
  • 60
  • 8
0
votes
1 answer

OnTouch in the style of OnClick

I'm trying to implement onTouch in my class used to remote control a mindstorms robot. I've still a lot of work to do, but for now I'm trying to tidy up the direct control which uses onClick. 5 buttons, 5 instantiations like the code below, which…
TroothHertz
  • 186
  • 2
  • 17
0
votes
1 answer

Lejos - Cannot find Symbol Tachopilot

Currently attempting to get some code to compile using Lejos for the Lego NXT brick. The command I run is nxjc Nxt_code.java and I get a Cannot find symbol error. TachoPilot has been imported. Here is the output from the console: `Nxt_code.java:14:…
silleknarf
  • 1,219
  • 6
  • 22
0
votes
1 answer

lejos noclassdeffounderror lejos/pc/comm/NXTComm

First I created a Java App to test my code to contact the NXT Brick using Bluetooth. Once this worked I created a Webservice instead which should connect to the NXT Brick through Bluetooth. This is where the problems start. My Webservice works…
hhoud
  • 518
  • 2
  • 6
  • 18
0
votes
4 answers

Why do static classes crash my robot?

I have made the static class below so any class may access any of my lejos robot's sensor methods without me having to make an instance for each class. However whenever I call a method such as StandardRobot.motorA.setPower(100) my robot crashes.…
Declan McKenna
  • 4,321
  • 6
  • 54
  • 72
0
votes
1 answer

Libraries not imported when editing Eclipse project in VS Code

So, I've been trying to edit my Java Eclipse project in VS Code. I installed the "Extension pack for Java" extension and tried to open my projects. Loading .jar files and JavaSE works great, but it seems it cannot load the…
0
votes
1 answer

jni.h no such file or directory

To install leJos for NXJ brick i follow the documentation tutorial , i set the variables like this : ` export NXJ_HOME=$HOME/leJOS_NXJ_0.9.1beta-3 export LEJOS_NXT_JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 export…
Raymond17
  • 73
  • 1
  • 9
0
votes
5 answers

String .replace() not applicable

I am trying to remove the non-number characters from my string. I have tried using the .replace() method but this returns with the error: The method replace(char, char) in the type String is not applicable for the arguments (String, String)…
0
votes
1 answer

read uploaded file on NXT Brick

I am trying to read the contents of a txt file which I have uploaded to my NXT bricks local file system but when I try to launch my application I get a NullPointerException public static String line(String coord) throws Exception { From what I can…
0
votes
1 answer

Lejos NXT ClassFormatException

Im trying to upload my script from my laptop to my NXT Bot. Connectinng to NXT using wire. When I press the Run as NXT button i get the following error: js.tinyvm.TinyVMException: Invalid byte tag in constant pool: 15 .... Caused by:…
0
votes
2 answers

Java time measurement incorrect

I have a java code that runs an endless loop, over and over again, and under certain conditions, I want to insert an additional step / function call into the loop. I defined these variables outside of the loop: static boolean wait_activate =…
Florian Bach
  • 919
  • 7
  • 22