View Single Post
  #5   Spotlight this post!  
Unread 23-12-2005, 22:03
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,800
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: Vex Programming help!

Quote:
Originally Posted by davelu
in the header file i defined BASE_DR pwm01=pwm02

Limit_Switch_Min(BASE_1_LIMIT,&BASE_DR);
but if i write it this way it doesn't
Limit_Switch_Min(BASE_1_LIMIT,&pwm01);
"BASE_DR" will be replaced in the call by "pwm01=pwm02"
so what you are getting is:

Limit_Switch_Min(BASE_1_LIMIT,&pwm01=pwm02); // your syntax error begins at the = sign.

when you really just wanted

Limit_Switch_Min(BASE_1_LIMIT,&pwm01);

Change your define to:
#define BASE_DR pwm01
and it will work the way you planned.

As to your other question I haven't had time to go look at the Vex controller yet to make sure.

P.S. The Vex start code prints the values of all the controls to the IFI terminal window in order, and you can see which ones change when you move each control.

#define PWM_in1 rxdata.oi_analog01 //Right joystick x
#define PWM_in2 rxdata.oi_analog02 //Right joystick y
#define PWM_in3 rxdata.oi_analog03 //Left joystick y
#define PWM_in4 rxdata.oi_analog04 //Left joystick x
#define PWM_in5 rxdata.oi_analog05 //Ch. 5 buttons on back of transmitter
#define PWM_in6 rxdata.oi_analog06 //Ch. 6 buttons on back of transmitter
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 24-12-2005 at 20:28.