|
Page 1 of 1
|
[ 6 posts ] |
|
Servo Communication Problem
Author |
Message |
teamschmidt
Rookie
Joined: Fri Oct 16, 2009 8:56 am Posts: 2
|
 Servo Communication Problem
Can someone help me with an error I can't seem to resolve for my students using robotc 1.93 and preparing for the FTC. We keep getting the following error...
**Error**:Compile time constant array index '65' is outside of array bound '0..23'
on the following line servo[servo1]=255;
In the context of if (joy1Btn(6)) { servo[servo1]=255; }
We can communicate with servo1 through the Servo debugger window so know that the name is correct and it is hooked up correctly...
Any thoughts?
|
Fri Oct 16, 2009 9:02 am |
|
 |
hatt
Rookie
Joined: Fri Oct 16, 2009 4:00 pm Posts: 2
|
 Re: Servo Communication Problem
I'm the team leader for this team - here are are #pragmas ... and the offending code. We've also tried removing the 'arm1' and simply leaving it blank, which I thought would set it to the default of 'servo1', which still gives an error. I've also tried 'ServoTarget[arm1],' but nothing seems to work.
|
Fri Oct 16, 2009 4:06 pm |
|
 |
l0jec
Expert
Joined: Mon Oct 27, 2008 9:59 pm Posts: 139
|
 Re: Servo Communication Problem
I had to test your issue out, but it looks like a bug in ROBOTC with how they address servos in the servo array. Specifically, I'm thinking the array was not modified when the servo controller pragmas were updated to allow for multiple servo controllers on other sensor ports in v1.93.
Not sure if this has already been reported, so mods, FYI. I get an array index out of bounds error when setting a target for any servo on a servo controller on sensor ports 2 through 4.
As for a workaround, just move your tetrix servo controller from sensor port 3 on your NXT to sensor port 1 and update the motor/servo/sensor setup appropriately and your code should compile fine.
|
Fri Oct 16, 2009 6:11 pm |
|
 |
hatt
Rookie
Joined: Fri Oct 16, 2009 4:00 pm Posts: 2
|
 Re: Servo Communication Problem
Thank you! We aren't with the robot right now (Tuesday is next meeting), but we will switch the servos around and see if that works.
|
Sat Oct 17, 2009 2:03 pm |
|
 |
teamschmidt
Rookie
Joined: Fri Oct 16, 2009 8:56 am Posts: 2
|
 Re: Servo Communication Problem
Tried it and it fixed problem. Switching servo controller to s1 did fix problem as a work around so I guess it is just a bug. Thanks so much for the help!
|
Mon Oct 19, 2009 8:21 am |
|
 |
l0jec
Expert
Joined: Mon Oct 27, 2008 9:59 pm Posts: 139
|
 Re: Servo Communication Problem
Glad to hear it worked. Hopefully this and other issues will be just a bad memory when the 2.x version is released soon. 
|
Mon Oct 19, 2009 9:57 am |
|
|
|
Page 1 of 1
|
[ 6 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 2 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|