Go to Post We considered naming our 2014 robot "Please Don't Point it at Me". I think the name fits. - KosmicKhaos [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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!
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:42.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi