View Single Post
  #1   Spotlight this post!  
Unread 29-03-2011, 00:10
ptan ptan is offline
Paul C. Tan., P.Eng.
AKA: Paul Tan
no team (Bolt Action)
Team Role: Mentor
 
Join Date: Dec 2005
Rookie Year: 2000
Location: Toronto
Posts: 61
ptan is a splendid one to beholdptan is a splendid one to beholdptan is a splendid one to beholdptan is a splendid one to beholdptan is a splendid one to beholdptan is a splendid one to behold
Max number of analog ports

Hi,

Is anyone out there using two 9201 analog breakouts with more than 8 ports total? We've come across a bug.

Steps to reproduce the bug:

Create a new Simple Robot project

Declare the following in the class (typing from memory, so please feel free to correct me):

AnalogChannel a1 = new AnalogChannel(1,1);
AnalogChannel a2 = new AnalogChannel(1,2);
AnalogChannel a3 = new AnalogChannel(1,3);
AnalogChannel a4 = new AnalogChannel(1,4);
AnalogChannel a5 = new AnalogChannel(1,5);
AnalogChannel a6 = new AnalogChannel(1,6);
AnalogChannel a7 = new AnalogChannel(1,7);


Now compile it, download it, and run it.
You will find that it compiles and runs ok.

Now add in the following declaration:

AnalogChannel b1 = new AnalogChannel(2,1);
AnalogChannel b2 = new AnalogChannel(2,2);

Compile, download, and run.
It will now fail (at runtime) saying Slot 2 Channel 1 is already allocated (or something like that).

Now comment out the following lines:

// AnalogChannel a5 = new AnalogChannel(1,5);
// AnalogChannel a6 = new AnalogChannel(1,6);
// AnalogChannel a7 = new AnalogChannel(1,7);

Compile, download, and run.

It will now work.

As far as I can tell (by trying different combinations), there seems to be a limitation on the TOTAL number of Analog Channels you can use!!!

If someone can try this code and let me know, I would really appreciate knowing if it is just something with our system, or if this is something everyone is facing.

Thanks!!
__________________
Paul C. Tan., P.Eng.
Coach - FTC Team 27 (now retired)
Coach - VRC Team 2027 (now retired)
Past Mentor - FRC Teams 188, 610, 1009, 2634
Reply With Quote