View Single Post
  #8   Spotlight this post!  
Unread 02-02-2008, 16:46
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,567
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: p1_sw_aux data type

Quote:
Originally Posted by personfromhell View Post
Thank you, I figured it would be essentially a Boolean value but wasn't sure because my code wasn't working. My next question is then why doesn't this code work:
Code:
  if(p2_sw_aux1) {
	pwm01 = 187;
  } else if(p2_sw_aux2) {
	pwm01 = 67;
  } else {
	pwm01 = 127;
  }
pwm01 goes to a motor that is meant to pivot two casters. I know that the victor its wired to works as well as the controller and cables and such. I know that in C++ the if statements should work but I haven't used C in a while and I forgot the differences in the two standards. Again, any help is greatly appreciated.
The code looks fine. Are you sure pwm01 isn't set to something else later in the code (for example, in the default code)?