View Single Post
  #1   Spotlight this post!  
Unread 28-03-2011, 15:34
duffany1 duffany1 is offline
Registered User
AKA: Brandon
FRC #0195 (The Cyberknights)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2006
Location: Southington, CT
Posts: 17
duffany1 is an unknown quantity at this point
Multiple analog modules? (C++)

We are using C++ and we're having trouble figuring out how to construct AnalogChannel objects when you have two analog modules.

I know there is a constructor for AnalogChannel that takes a slot and a channel as parameters, but for some reason this did not work for us. For instance, we tried this code (whittled down):

Code:
// In global section
enum cRIO_slots {cRIO_slot_1 = 1, cRIO_slot_2, cRIO_slot_3}; // And so on
enum analog_mod_channels {gripper_pot_channel = 1}; // And so on

// In the spot where objects are declared
AnalogChannel gripper_potentiometer;

// In the spot where all the objects get constructed
gripper_potentiometer(cRIO_slot_1, gripper_pot_channel),
This code basically did not work. In fact, it caused certain things to go completely out of control.

What are we missing here? Are the modules 0, 1, 2, 3 instead of 1, 2, 3, 4, or something?

Thanks in advance!