Problem running iCommand Melody.java sample code

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

Moderators: 99jonathan, roger, imaqine

Problem running iCommand Melody.java sample code

Postby paulreiners » Tue Oct 16, 2007 10:14 pm

I'm trying to run the iCommand Melody.java code contained in the samples folder. It seems to run okay. Here is the output:

Properties location: C:\Documents and Settings\Administrator\icommand.properties
BlueCove version 2.0.0 on winsock
File successfully uploaded
BlueCove stack shutdown completed


However, no sound plays!

Does anyone know what is going wrong here?
paulreiners
New User
 
Posts: 8
Joined: Sun Oct 07, 2007 12:20 am
Location: Minnesota

Postby ulin » Wed Oct 17, 2007 3:06 am

NXTCOMM = COM6
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
File successfully uploaded



it seems ok on my PC!!
ulin
New User
 
Posts: 1
Joined: Wed Oct 17, 2007 3:04 am

Postby bbagnall » Sat Oct 20, 2007 6:30 pm

Hi Paul,

There's a file it should upload to your NXT brick called "Monkey Island.rso". After you run the program, try turning on your brick and see if it did in fact upload Monkey Island.rso to your brick. If not, maybe it has something to so with the .rso file not being in the right directory as your code.

You can try manually uploading it to the brick using NXTExplorer.
User avatar
bbagnall
Site Admin
 
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm

Postby emh » Sat Dec 15, 2007 6:53 pm

Hello,

I am experiencing the same problem.

I am running the Melody.java sample in Eclipse. The bluetooth connection seems to be ok, anyway, the programm exits with the following console output:

BlueCove version 2.0.0 on widcomm
File successfully uploaded
BlueCove stack shutdown completed

Still, no sound is being played on the brick. But if i look in the brick I can find Monkey Island.rso on the brick and can also replay it manually on the brick.
But it seems as if the method call
Sound.playSoundFile(myFile.getName());
in the Melody.java file has no effect.

I am using the Mindstorms firmware 1.05 and ICommand 0.6.
I also don't know if it could be a problem with the bluetooth ports, but since the file upload seems to work, I don't know if that is a problem.

Does somebody know what the problem could be?

Thanks,

emh
emh
New User
 
Posts: 12
Joined: Sat Dec 15, 2007 6:48 pm

Postby bbagnall » Tue Dec 25, 2007 6:03 pm

You can troubleshoot this but substituting this line:
Code: Select all
Sound.playSoundFile(myFile.getName());


With this:
Code: Select all
int i = Sound.playSoundFile(myFile.getName());
System.out.println("Error: " + i);


If you get anything other than 0, it means there was an error. My guess is the file name is wrong for some reason. The Lego communication protocol docs mention what each error means. See Appendix 1, page 16:
· Success 0x00
· No more handles 0x81
· No space 0x82
· No more files 0x83
· End of file expected 0x84
· End of file 0x85
· Not a linear file 0x86
· File not found 0x87
· Handle all ready closed 0x88
· No linear space 0x89
· Undefined error 0x8A
· File is busy 0x8B
· No write buffers 0x8C
· Append not possible 0x8D
· File is full 0x8E
· File exists 0x8F
· Module not found 0x90
· Out of boundary 0x91
· Illegal file name 0x92
· Illegal handle 0x93

You'll have to convert result to hexadecimal.
User avatar
bbagnall
Site Admin
 
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm


Return to NXJ Software

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron
more stuff