Quote:
|
Originally Posted by ealex292
How would I go about doing that, since SIG and BLK aren't next to each other? Should I get some wire and try to connect them that way?
|
There is an easier way if you have two wire connectors to the limit switches.
The default EDU code sets up several Digital I/O pins as inputs and adjacent ones as outputs. This is so you can use adjacent signal pins for your limit switches. You can change these definitions in user_routines.c in the User_Initialization function.
Code:
IO6 = IO8 = IO10 = INPUT; /* Used for limit switch inputs. */
IO12 = IO14 = IO16 = INPUT; /* Used for limit switch inputs. */
/* FOURTH: Set up the pins you want to use as digital OUTPUTs. */
IO3 = IO4 = OUTPUT;
IO5 = IO7 = IO9 = OUTPUT; /* For connecting to adjacent limit switches. */
IO11 = IO13 = IO15 = OUTPUT; /* For connecting to adjacent limit switches. */
For example, this allows you to connect your limit switch to the two signal pins on Digital I/O 6 and 5. Then you test rc_dig_out06 in your code for an open or closed switch.