View Single Post
  #4   Spotlight this post!  
Unread 01-04-2009, 16:19
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Re: Trouble programming Digital I/O toggle switches in C++

My best suggestion would be to check when you instantiate the switches. If you use the simpler constructor for them, they might use a 'default' slot on the cRio that you do not expect.

I forget the exact function signature, but you might be doing
Switch1 = new DigitalInput(1); // initializes it to use channel 1 on slot pi

If you're doing that, try using the constructor that explicitly sets the slot to the cRio slot that you're using:
Switch1 = new DigitalInput(4,1); // uses slot 4, channel 1 (might use slot 1, channel 4. Check the DigitalInput.h file)
Reply With Quote