View Single Post
  #2   Spotlight this post!  
Unread 23-01-2008, 13:32
TubaMorg TubaMorg is offline
Programmermechanicalelect ricalcoach
AKA: Dan
FRC #1480 (Robatos Locos)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Houston
Posts: 450
TubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond repute
Re: Help with automatic relay control

If you post your code, we can tell you what the problem is. If I understand what you are trying to do correctly, it should look a little like this:

Code:
if (pwm_val > (127 + deadband) || pwm_val < (127 - deadband))
{
relay = rev; // out of neutral condition
} else
{
relay = fwd; // in neutral condition
}

Last edited by TubaMorg : 23-01-2008 at 13:33. Reason: neurtal != neutral