View Single Post
  #3   Spotlight this post!  
Unread 10-02-2007, 20:56
chris31 chris31 is offline
Team 2021 Captain
AKA: Chris Davidson
FRC #2021 (FA Robotics)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2006
Location: Atlanta, GA/ Fredericksburg,VA
Posts: 949
chris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond repute
Send a message via AIM to chris31
Re: Rotating Servo HS322 over 90 degrees

Quote:
Originally Posted by fimmel View Post
you have 2 if statements you need an else statement

here is an example:
Code:
 if (p1_sw_trig ==1)
{
pwm11 = 255;
}
if else (p1_sw_top == 1)
{
pwm11 = 0;
}
else {
}
hope that works.....im sorta new to programming

/forest
It should be an "else if" not "if else". Also the last "else" doesnt need to be there as you arent using it for anything.