z2daj,
You need to understand that the CD community consists of VERY good mentors who pretty much could solve your problem in a matter of seconds if they were there and able to collect the information they need. What you perceive as a snotty remark is probably a bit a frustration on our part by the inability to get the information we need.
It's a limit switch, and we want to get you up and running ASAP.
Can you answer these questions for us?
1. Does your switch, when hooked up with the robot powered on, measure 5V and then change to 0V across the terminals when you press and release your switch?
2. Where exactly is your switch hooked up on the digital side car? Digital I/O 4? Not relays, or PWM?
3. Is there anything else hooked up to this Digital Side Car? Speed controllers? Other switches/sensors?
4. Do these other items on the Digital Side Car work? Are all the green LEDs on?
5. Where is the Digital Side Car hooked up to on the cRIO? To a DIO module in slot 4? Using the originally supplied cable? Are the thumbscrews screwed in?
6. If your switch is hooked up to digital input 4 on the digital side car, and the digital sidecar is hooked up to the cRIO through a DIO module in the fourth slot (fourth counted from the end with the power connector) then your initialization should be:
Code:
Dig4 = new DigitalInput(4);
Can you verify if that is what you are using?
6. Add a printf line to the end of your teleop code:
Code:
printf("DIO4: %d\n",Dig4->Get());
7. Open a Target Console in WindRiver by right-clicking VxWorks6x in the bottom-left window then Target Tools->Target Console
8. The Target Console should now spit out the state of your switch continuously. Does it ever switch from 1 to 0 when you press your switch?
9. Are there any experienced teams in your area you can contact? Two days to burn on a limit switch is too much, and if I were in your shoes, I'd get help in person ASAP. FIRST is a wonderful thing - I'm sure someone would be willing.