|
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)
|