nxtCommand.startProgram via Bluetooth

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: roger, imaqine, 99jonathan

New User
Posts: 1
Joined: Sat Jul 21, 2012 8:47 am

nxtCommand.startProgram via Bluetooth

Postby ferwango » Sat Jul 21, 2012 8:56 am

Here is the code that works for me, I added all the jars of lejos except classes.jar, besides I also added bluecove.jar :

Code: Select all

package nxtazul;

import lejos.nxt.remote.NXTCommand;
import lejos.pc.comm.NXTComm;
import lejos.pc.comm.NXTCommFactory;
import lejos.pc.comm.NXTInfo;

public class NXTAzul {

    public static void main(String[] args) {

        try {
            NXTInfo info = new NXTInfo(NXTCommFactory.BLUETOOTH, "NXT", "00:16:53:10:ec:fd");
            NXTComm link = NXTCommFactory.createNXTComm(NXTCommFactory.BLUETOOTH);
            boolean connected = link.open(info, NXTComm.LCP);

            NXTCommand cmd = new NXTCommand(link);

            if (!connected) {
                System.out.println("No se puede establecer la conexion!");
            } else {
                System.out.println("Conexion exitosa!");

                if (cmd.isOpen()) {
                } else {
                    System.out.println("Comando Fallido");

        } catch (Exception e) {


I hope this be useful for someone :D

Return to “NXJ Software”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest