Rickz2020 wrote:Oops. You need the button import too.
- Code: Select all
import lejos.nxt.Button;
Oh, thank you! I've forgot too. Will try it tomorrow.
Rickz2020 wrote:Are you not using an IDE? I recommend Eclipse if you aren't - it's great and there is a leJOS plugin available, too.
If you use the Eclipse IDE with the plugin, you can rest the mouse pointer over the error (it will have a red line under any errors), it will give you the option to add the import as well as give recommendations for other errors.
I have tried Netbeans, but i don't find it useful. I have failed to proceed with setting it up to compile programs for nxt brick, and it also failed to detect all leJOS libraries, so it's as usefull as notepad currently, and it's assistant is just annoying dumb because of no link with leJOS. After trying Netbeans on few different PCs I don't believe it could installed smoothly and in standard way. Is Eclipse more accurate?
Rickz2020 wrote:- Code: Select all
int pspbuttons[] = new int[16];
pspbuttons=controller.getButtons();
I don't see what is wrong with that... No idea why it's telling you that it found a "short" and requires an "int".
Also have no idea. The good side of this way (against using
- Code: Select all
controller.getButtons()[i]
) is that i don't need to get state N times to analyze N buttons. Getting state requires lots of time as far as i know (compared with simple math), and if I want to do smoothening or other analysis, i couldn't act in a way of "controller.getButtons()[i]".
Will write if i get the point.
Rickz2020 wrote:I've got no idea why you are getting errors for:
- Code: Select all
int lx=controller.getLeftX();
int ly=controller.getLeftY();
int rx=controller.getRightX();
int ry=controller.getRightY();
They work fine for me.
Let me know how you get on.
I will. Possibly, the problem is old version of leJOS on PC. I have downloaded the newest one. Could I just run it and install new one on the top of previous? Or should I uninstall the previous leJOS before installing new one?
A little bit nervous about it, because currently JDK and leJOS runs on laptop on which i do my work (stupid, i know

. So i could not reinstall OS if JDK or leJOS behaves wrong.