View Single Post
  #3   Spotlight this post!  
Unread 15-02-2005, 23:10
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,785
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Programming motors with joystick buttons

Same sort of thing would work if you have the window motor on a spike.
Code:
if (p1_sw_trig==1)
{
	relay2_fwd = 1;
	relay2_rev = 0;
}
else if (p1_sw_top==1)
{
	relay2_fwd = 0;
	relay2_rev = 1;
}
else
{
	relay2_fwd = 0;
	relay2_rev = 0;
}
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle