View Single Post
  #10   Spotlight this post!  
Unread 20-01-2004, 10:27
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,793
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Some EDURobotics Problems

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.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle