by gloomyandy » Wed Mar 28, 2012 4:41 pm
Do you mean when you run your NXT program you are no longer able to talk to it from your PC program? If so then this is because when your program runs it is the only program running on the NXT, there is no other program waiting around to receive commands over Bluetooth. When the leJOS menu program is running it contains the code to do this and is running this code, but once your program starts the menu no longer runs. So if you want to be able to issue commands from the PC then you will need to include the code to handle Bluetooth within your program. If yopu want to use the standard Lego Command Protocol (LCP) to do this then you can use some of the standard leJOS classes, look at the leJOS documentation for classes that begin LCP.
However what does your NXT program do? It may not make sense to have both it and your PC program trying to control the NXT at the same time....
Andy