View Single Post
  #5   Spotlight this post!  
Unread 09-02-2002, 09:38
Unsung FIRST Hero
Warren Boudreau Warren Boudreau is offline
Registered User
FRC #0180 (Team SPAM)
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 1999
Location: Stuart, FL
Posts: 354
Warren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond reputeWarren Boudreau has a reputation beyond repute
Your code looks about right. You may have a hardware problem.

Are you using a joystick or a switch wired in to the p1_sw_top pin on port 1? Using the joystick, you should get 0 when the button is not depressed and 1 when it is. It's easy enough to throw in a debug to verify that.

If you are using a switch wired in to the port make sure that you are wired to the normally open side of the switch. If the switch has three tabs on it, usually one will have NO and another will have NC next to them. NO is normally open, NC is normally closed. The third tab wil go to ground.

Once again, debug statements are the way to go. I always check out the code operation without any PWMs or relays plugged in to the Robot Controller and use debug statements to verify operation. This tip comes from a bitter experience as the team rookie coder when I loaded up my first ever piece of code and promptly destroyed our lifting mechanism. Ouch, that hurt.

I hope this helps.
__________________
Warren B

Pool Noodles. They're not just for bumpers anymore.