|
|
|
![]() |
|
|||||||
|
||||||||
11-05-2011 13:15
RyanNI see a problem with how your accessing your array elements. Arrays start at 0, and go to n-1, where n is the number of elements. LabVIEW, however, is usually good about handling these kind of problems and not crashing, but it all depends on what your default 'out of bounds' value is. If it's blank, then you might be trying to drive the wrong motor. In any case, reducing all your array elements by 1 should fix it.
So 3 will be 2. 2 will be 1, and 1 will be 0.
I noticed that you misspelled rightMotor in the 3rd array element. Since it's a ring constant, the spelling doesn't matter, but for future reference, take note in how you spell things, as it can, and will break your code (our programmers did this a lot this year).
Everything else that I see looks good. Let me know how that works.
12-05-2011 10:15
EthanMillerThanks, but the problem was solved when we switched back to RobotC - I appreciate the effort, though, and I'll try that when I get the chance to reimage the NXT.
12-05-2011 11:38
EricVanWykEthan -
Ryan is correct. The issue is that you are attempting to look at an element that doesn't exist.
Out of curiosity - why are you using an array? Wouldn't it be easier to use the elements directly?