View Single Post
  #3   Spotlight this post!  
Unread 14-02-2006, 21:42
Keith Watson Keith Watson is offline
Registered User
FRC #0957 (WATSON)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Wilsonville, OR
Posts: 112
Keith Watson is just really niceKeith Watson is just really niceKeith Watson is just really niceKeith Watson is just really nice
Re: A few simple programming questions;

Quote:
Originally Posted by Oumonkey
if(p3_sw_trig == 1)
{
pwm09 = 0;
pwm10 = 0;
}
else (p3_sw_trig == 0);
{
pwm09 = 254;
pwm10 = 254;
}
The portion highlighted in red is a syntax error. There are two ways to correct the error. Since the value of the variable can only be 0 or 1 you can just delete the portion in red. Or you can change the syntax to:
Code:
if (p3_sw_trig == 1)
{
   pwm09 = 0;
   pwm10 = 0;
}
else if (p3_sw_trig == 0)
{
   pwm09 = 254;
   pwm10 = 254;   
}
__________________
Keith Watson - Professional Software Engineer
No relation to "Kevin" Watson, who created the camera tracking code.